Fix detection of the ci/no-release label in a push event#7917
Merged
pavoljuhas merged 2 commits intoquantumlib:mainfrom Mar 2, 2026
Merged
Fix detection of the ci/no-release label in a push event#7917pavoljuhas merged 2 commits intoquantumlib:mainfrom
pavoljuhas merged 2 commits intoquantumlib:mainfrom
Conversation
The release-main workflow is triggered by "push" event which
does not carry `github.event.pull_request.labels`.
Here we switch to GitHub CLI to lookup the PR from commit and
test for the "ci/no-release" label.
Note `gh pr list --search=COMMIT` may give several matches hence
the extra check with `grep "${GITHUB_SHA}"`.
Follow-up to quantumlib#7915
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7917 +/- ##
==========================================
- Coverage 99.62% 99.62% -0.01%
==========================================
Files 1104 1104
Lines 99375 99375
==========================================
- Hits 99000 98999 -1
- Misses 375 376 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
mhucka
approved these changes
Mar 2, 2026
Contributor
mhucka
left a comment
There was a problem hiding this comment.
Trivial nits, optional. Otherwise LGTM.
.github/workflows/release-main.yml
Outdated
Contributor
There was a problem hiding this comment.
PyPi → PyPI
Possibly the most trivial nit of all time.
.github/workflows/release-main.yml
Outdated
| if gh pr list --state=merged --search="${GITHUB_SHA}" --label=ci/no-release \ | ||
| --json=mergeCommit --jq=".[].mergeCommit.oid" | grep -q "${GITHUB_SHA}"; | ||
| then | ||
| echo "The PR has ci/no-release label - skipping the release" |
Contributor
There was a problem hiding this comment.
Suggested change
| echo "The PR has ci/no-release label - skipping the release" | |
| echo "The PR has a ci/no-release label - skipping the release" |
Collaborator
Author
Thanks for catching those, done in 65f9096 |
pavoljuhas
added a commit
to pavoljuhas/Cirq
that referenced
this pull request
Mar 2, 2026
Problem: `gh pr list --state=merged` may not find the pull request due to race condition at its push event. Solution: Extract pull request number from the commit subject and look up its labels directly. Follow-up to quantumlib#7917
github-merge-queue bot
pushed a commit
that referenced
this pull request
Mar 3, 2026
Problem: `gh pr list --state=merged` may not find the pull request due to race condition at its push event time. Solution: Extract pull request number from the commit subject and look up its labels directly. Follow-up to #7917
BichengYing
pushed a commit
to BichengYing/Cirq
that referenced
this pull request
Mar 3, 2026
Problem: `gh pr list --state=merged` may not find the pull request due to race condition at its push event time. Solution: Extract pull request number from the commit subject and look up its labels directly. Follow-up to quantumlib#7917
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The release-main workflow is triggered by "push" event which
does not carry
github.event.pull_request.labels.Here we use the GitHub CLI instead to lookup the PR from commit and
check if it has the "ci/no-release" label.
Note
gh pr list --search=COMMITmay give several matches hencethe extra check with
grep "${GITHUB_SHA}".Follow-up to #7915