Skip to content

ci: approve only the release pull request's run for its current head - #12

Merged
malhashemi merged 1 commit into
mainfrom
ci/approve-exact-release-run
Sep 26, 2026
Merged

malhashemi merged 1 commit into
mainfrom
ci/approve-exact-release-run

Conversation

@malhashemi

Copy link
Copy Markdown
Owner

No description provided.

fi
for attempt in $(seq 1 12); do
# Only the run for the branch's current head: older runs on the same branch are stale.
sha=$(gh api "repos/$GITHUB_REPOSITORY/git/ref/heads/$branch" -q .object.sha)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High workflows/release.yml:55

The approval step never selects the waiting CI run for a normal mergeable release PR, so the release PR remains blocked until manual approval. sha is the branch head commit from refs/heads/$branch, but headSha for a pull_request run is the generated merge commit; compare against the PR's merge_commit_sha instead.

-          sha=$(gh api "repos/$GITHUB_REPOSITORY/git/ref/heads/$branch" -q .object.sha)
+          sha=$(gh api "repos/$GITHUB_REPOSITORY/pulls?head=$GITHUB_REPOSITORY:$branch&state=open&per_page=1" -q '.[0].merge_commit_sha // empty')
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @.github/workflows/release.yml around line 55:

The approval step never selects the waiting CI run for a normal mergeable release PR, so the release PR remains blocked until manual approval. `sha` is the branch head commit from `refs/heads/$branch`, but `headSha` for a `pull_request` run is the generated merge commit; compare against the PR's `merge_commit_sha` instead.

@malhashemi
malhashemi merged commit b91a745 into main Sep 26, 2026
5 checks passed
@malhashemi
malhashemi deleted the ci/approve-exact-release-run branch September 26, 2026 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant