fix(labels): use gh jq for paginated label reads#424
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the label audit dry-run script to use gh api --jq instead of --template, aiming to preserve paginated label reads as newline-delimited JSON while restoring compatibility with GitHub CLI versions that don’t support the template json function.
Changes:
- Replaced
gh api --templateoutput formatting withgh api --jq '.[]'for paginated label listing. - Kept the script’s paginated label read path intended to produce newline-delimited JSON objects for downstream parsing.
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
gh api --templateusage withgh api --jq '.[]'ghversion, where the templatejsonfunction is unavailableTest Plan
ruby -c scripts/labels-dry-run.rbscripts/labels-dry-run.rb --repo z-shell/.github --include-cleanscripts/labels-dry-run.rb --repo z-shell/ziscripts/labels-dry-run.rb --repo z-shell/.github --json | ruby -rjson -e 'data=JSON.parse($stdin.read); puts "repos=#{data["repos_scanned"]} drift=#{data["repos_with_drift"]}"'scripts/labels-dry-run.rb --repo z-shell/.github --all-reposexits 2Follow-up for #411 and #423.