Skip to content

fix(labels): use gh jq for paginated label reads#424

Merged
ss-o merged 1 commit into
mainfrom
fix/label-dry-run-gh-pagination
May 23, 2026
Merged

fix(labels): use gh jq for paginated label reads#424
ss-o merged 1 commit into
mainfrom
fix/label-dry-run-gh-pagination

Conversation

@ss-o
Copy link
Copy Markdown
Member

@ss-o ss-o commented May 23, 2026

Summary

  • replace the dry-run helper's gh api --template usage with gh api --jq '.[]'
  • keeps paginated label reads as newline-delimited JSON objects
  • fixes compatibility with the installed gh version, where the template json function is unavailable

Test Plan

  • ruby -c scripts/labels-dry-run.rb
  • scripts/labels-dry-run.rb --repo z-shell/.github --include-clean
  • scripts/labels-dry-run.rb --repo z-shell/zi
  • scripts/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-repos exits 2

Follow-up for #411 and #423.

@ss-o ss-o requested a review from a team as a code owner May 23, 2026 00:23
Copilot AI review requested due to automatic review settings May 23, 2026 00:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 --template output formatting with gh api --jq '.[]' for paginated label listing.
  • Kept the script’s paginated label read path intended to produce newline-delimited JSON objects for downstream parsing.

Comment thread scripts/labels-dry-run.rb
@ss-o ss-o merged commit 4978f78 into main May 23, 2026
4 checks passed
@ss-o ss-o deleted the fix/label-dry-run-gh-pagination branch May 23, 2026 00:30
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.

2 participants