Skip to content

Commit 7ef68f3

Browse files
authored
Merge pull request #2017 from minrk/test-this-pr-env-token
use test-this-pr access token to report status
2 parents 62bee99 + c571208 commit 7ef68f3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

.github/workflows/cd.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ jobs:
277277
#
278278
# This job will only run on push events made to test-this-pr/** branches
279279
if: github.event_name == 'push' && contains(github.ref, 'test-this-pr')
280+
environment: test-this-pr-env
280281
runs-on: ubuntu-latest
281282
steps:
282283
# Poll the GitHub REST API and wait for staging-deploy job to finish
@@ -290,7 +291,7 @@ jobs:
290291
while [ "$STATUS" != "completed" ]; do
291292
RESPONSE=$(curl --silent --request GET \
292293
--url 'https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs' \
293-
--header 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' \
294+
--header 'Authorization: token ${{ secrets.TEST_THIS_PR_ACCESS_TOKEN }}' \
294295
--header 'Accept: application/vnd.github.v3+json')
295296
296297
STATUS=$(echo $RESPONSE | jq -r '.jobs[] | select(.name | startswith("staging-deploy")) | .status')
@@ -318,7 +319,7 @@ jobs:
318319
if: ${{ steps.staging-deploy-status.outputs.status }} == 'completed'
319320
uses: actions/[email protected]
320321
with:
321-
github-token: ${{ secrets.GITHUB_TOKEN }}
322+
github-token: ${{ secrets.TEST_THIS_PR_ACCESS_TOKEN }}
322323
script: |
323324
var JOB_STATUS = process.env.JOB_STATUS;
324325
var PR_NUMBER = process.env.PR_NUMBER;

0 commit comments

Comments
 (0)