build: use context.sha (#6900)

This commit is contained in:
Zach Pomerantz 2023-07-07 10:48:00 -07:00 committed by GitHub
parent 552a38994b
commit c8a17f5fe9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

@ -21,7 +21,7 @@ jobs:
const statuses = await github.rest.repos.listCommitStatusesForRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: context.payload.head_commit.sha
ref: context.sha
})
const status = statuses.data.find(status => status.context === 'Test / promotion')?.state || 'missing'
core.info('Status: ' + status)

@ -179,7 +179,7 @@ jobs:
github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.payload.head_commit.sha,
sha: context.sha,
state: 'pending',
context: 'Test / promotion',
description: 'Running tests...',
@ -197,7 +197,7 @@ jobs:
github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.payload.head_commit.sha,
sha: context.sha,
state: ${{ env.STATUS }} ? 'success' : 'failure',
context: 'Test / promotion',
description: ${{ env.STATUS }} ? 'All tests passed' : 'One or more tests failed and are blocking promotion',