Skip to content

Commit

Permalink
Release promotion - correct check/status interaction (#429)
Browse files Browse the repository at this point in the history
* Release promotion - correct check/status interaction

Why: the SHA passed for the check/status interactions was incorrect and the HTTP method used for the initial observation was wrong.
  • Loading branch information
k-wall authored Nov 22, 2024
1 parent 75c355d commit 3d7676a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/promote_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ jobs:
- name: 'Get heads'
run: |
# Get PR's ref.
echo "PR_REF=$(git rev-list -n 1 origin/${PR_BRANCH})" >> $GITHUB_ENV
# Get main's current head
echo "MAIN_HEAD=$(git rev-list -n 1 main)" >> $GITHUB_ENV
Expand All @@ -127,10 +130,10 @@ jobs:
env:
GH_TOKEN: ${{ secrets.KROXYLICIOUS_RELEASE_TOKEN }}
run: |
STATUS=$(gh api --method POST \
STATUS=$(gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/commits/${PR_MAIN_REF}/check-runs \
/repos/${{ github.repository }}/commits/${PR_REF}/check-runs \
| jq --exit-status -r '.check_runs[] | select(.name=="build") | .status + "/" + .conclusion')
if [[ ${STATUS} != "completed/success" ]]; then
Expand Down Expand Up @@ -169,7 +172,7 @@ jobs:
gh api --method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/statuses/${PR_MAIN_REF} \
/repos/${{ github.repository }}/statuses/${PR_REF} \
-f "state=success" \
-f "description=Release to Maven Central is complete" \
-f "context=maven-central"
Expand Down

0 comments on commit 3d7676a

Please sign in to comment.