Skip to content

Commit f1850e0

Browse files
committed
Use gh pr view instead of gh api for cleaner PR data fetch
Address review feedback: use the higher-level `gh pr view` command with --json and --jq instead of constructing the raw API URL.
1 parent ee3e7a8 commit f1850e0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/pr-metadata-check.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ jobs:
3939
4040
# Fetch live PR data to avoid stale event payload (race condition
4141
# when labels/milestone are added shortly after PR creation).
42-
PR_JSON=$(gh api "repos/${GH_REPO}/pulls/${PR_NUMBER}" \
42+
PR_JSON=$(gh pr view "${PR_NUMBER}" --repo "${GH_REPO}" \
43+
--json assignees,labels,milestone \
4344
--jq '{assignees: .assignees, labels: .labels, milestone: (.milestone.title // empty)}')
4445
ASSIGNEES=$(echo "$PR_JSON" | jq '.assignees')
4546
LABELS=$(echo "$PR_JSON" | jq '.labels')

0 commit comments

Comments
 (0)