From cb3763edf2d5e874e3b431699044f6b047e69908 Mon Sep 17 00:00:00 2001 From: Ethan Zimbelman Date: Wed, 20 Mar 2024 11:10:05 -0700 Subject: [PATCH] ci(test): share environment secrets with pull requests from forked prs (#297) --- .github/workflows/main.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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