fix(pr-status-sync): gh api --jq doesn't support jq's --arg flag#1
Open
octavianorg wants to merge 1 commit into
Open
fix(pr-status-sync): gh api --jq doesn't support jq's --arg flag#1octavianorg wants to merge 1 commit into
octavianorg wants to merge 1 commit into
Conversation
The open-pr job's stale base-label cleanup passed --jq --arg l "$BASE_LABEL" '...' directly to `gh api`, but `gh api --jq` only accepts a single filter string — it has no --arg support. The shell parsed "--arg" as the filter itself and left "l", "$BASE_LABEL", and the real filter as three stray positional args, which `gh api` rejects with "accepts 1 arg(s), received 4". This fired on every PR opened/reopened event. Fixed by fetching labels via `gh api --jq` (no vars needed there) and piping through a real `jq --arg` call, matching the pattern already used elsewhere in this file for the closed-PR path. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR status synchronization workflow now computes stale base labels with a two-stage jq pipeline: extracting label names first, then filtering them against ChangesPR status synchronization
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
opened/reopenedevent triggered a failure in thesync / open-prjob ofpr-status-sync.ymlwithaccepts 1 arg(s), received 4gh api ... --jq --arg l "$BASE_LABEL" '...'—gh api --jqonly accepts a single filter string; it has no--argsupport like the standalonejqbinary. The shell consumed--argas the filter itself, leavingl,$BASE_LABEL, and the real filter as three stray positional args togh api, which only accepts one (the endpoint)gh api --jq '[.[].name]'and piping into a realjq -r --argcall — the same pattern already used correctly elsewhere in this file (the closed-PR path)Test plan
gh api --jq --argoccurrences exist elsewhere in this file/repoSummary by CodeRabbit