Skip to content

Commit

Permalink
Set status on PR head, not merge commit. Sigh.
Browse files Browse the repository at this point in the history
  • Loading branch information
anomiex committed Jan 21, 2025
1 parent d0fa49f commit a2edd37
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/files/coverage-munger/upload-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# - GITHUB_TOKEN: GitHub API token.
# - GITHUB_REPOSITORY: GitHub repo.
# - GITHUB_SHA: Commit SHA.
# - PR_HEAD: SHA for the PR head commit (versus GITHUB_SHA which is a merge commit)
# - PR_ID: PR number or "trunk".
# - SECRET: Shared secret.
# - STATUS: Status of the coverage run.
Expand Down Expand Up @@ -112,7 +113,7 @@ if [[ "$PR_ID" != "trunk" ]]; then
fi
jq . <<<"$JSON"
curl -v -L --fail \
--url "${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/statuses/${GITHUB_SHA}" \
--url "${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/statuses/$( jq --arg V "$PR_HEAD" -nr '$V | @uri' )" \
--header "authorization: Bearer $API_TOKEN" \
--header 'content-type: application/json' \
--data "$( jq -c --arg PR "$PR_ID" '{
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ jobs:
PR_ID: ${{ github.event_name != 'pull_request' && 'trunk' || github.event.pull_request.number }}
SECRET: ${{ secrets.CODECOV_SECRET }}
STATUS: ${{ needs.run-tests.outputs.coverage-status }}
PR_HEAD: ${{ github.event.pull_request.head.sha }}
run: .github/files/coverage-munger/upload-coverage.sh

storybook-test:
Expand Down

0 comments on commit a2edd37

Please sign in to comment.