diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8845c5a7..10ad0795 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,6 @@ name: Tests on: - pull_request: + pull_request_target: push: branches: - main @@ -8,8 +8,11 @@ on: jobs: unit_tests: runs-on: ubuntu-latest + environment: staging steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} - run: npm ci && npm run build - run: npm test @@ -18,6 +21,8 @@ jobs: environment: staging steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} - run: npm ci && npm run build - name: Post message to Slack via botToken id: slackToken @@ -51,6 +56,8 @@ jobs: environment: staging steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} - run: npm ci && npm run build - run: echo "${{ github.event_name }}" - name: push trigger @@ -85,6 +92,8 @@ jobs: environment: staging steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} - run: npm ci && npm run build - run: echo "${{ github.event_name }}" - name: Post message to Slack via incoming webhook @@ -106,6 +115,8 @@ jobs: environment: staging steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} - run: npm ci && npm run build - name: Dump out GitHub Context run: echo $JSON