fix(scripts): tolerate restricted PR metadata tokens (#121848)

Amp-Thread-ID: https://ampcode.com/threads/T-019feaaa-c7ed-769e-9f29-a3612bec72e7

Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Peter Steinberger
2026-08-10 23:30:59 -07:00
committed by GitHub
parent 9df9cc2228
commit c8571daa2f
2 changed files with 18 additions and 1 deletions
+1 -1
View File
@@ -102,7 +102,7 @@ enter_worktree() {
pr_meta_json() {
local pr="$1"
local metadata files expected_file_count actual_file_count head_before head_after
metadata=$(gh pr view "$pr" --json number,title,state,isDraft,author,baseRefName,headRefName,headRefOid,headRepository,headRepositoryOwner,url,body,labels,assignees,reviewRequests,changedFiles,additions,deletions,statusCheckRollup,files)
metadata=$(gh pr view "$pr" --json number,title,state,isDraft,author,baseRefName,headRefName,headRefOid,headRepository,headRepositoryOwner,url,body,labels,assignees,changedFiles,additions,deletions,statusCheckRollup,files)
head_before=$(printf '%s\n' "$metadata" | jq -r .headRefOid)
expected_file_count=$(printf '%s\n' "$metadata" | jq -r .changedFiles)