ghas-setup: 既存 config lookup の --slurp+--jq 併用エラーを修正#15
Merged
Conversation
gh api は `--slurp` を `--jq` と併用できず("the --slurp option is not supported with --jq or --template")、本適用の冪等 lookup が実行時に失敗して いた。--slurp をやめ、--paginate でページごとに --jq を適用して一致 id を出し、 複数行になっても先頭行のみ採用する(head パイプを使わないため SIGPIPE + pipefail での誤失敗も起きない)。 bats の gh スタブが実 gh のフラグ制約を再現しておらず見逃したため、スタブ側で `--slurp` + `--jq` 併用を非 0 終了として再現し、同種 regression を検知できる ようにした。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
ユーザー指示の要点
dogfooding(
airsorg への本適用)でghas-setupが実行時エラー:変更の概要
--slurpを除去。gh apiは--slurpを--jq/--templateと併用できない仕様のため、--paginateでページごとに--jqを適用して一致 id を出力し、コマンド置換で受けて先頭行のみ採用する(headパイプを使わないため pagination 途中の SIGPIPE +set -o pipefailでの誤失敗も起きない)。pagination による全件検索(30 件超でも取りこぼさない)は維持。--slurp+--jq併用を非 0 終了として再現し、同種の regression を検知できるようにした。レビューのポイント
CONFIG_ID=${CONFIG_ID%%$'\n'*}による先頭行採用(重複名は org では起きない前提だが、複数行でも壊れないための保険)。gh api --paginate --jq(--slurpなし)が正常動作することを確認済み。検証方法
nix flake check→ all checks passed(bats 8 件含む)。nix run .#ghas-setup -- --dry-runでorg: airsの解決と叩く API 表示を確認。🤖 Generated with Claude Code