Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion scripts/initiative-planner/gather-context.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,14 @@ ref_json='[]'
if [[ -n $refs ]]; then
ref_json="$(while IFS= read -r n; do
[[ -n $n ]] || continue
# A referenced #N may be an issue, a PR, a Discussion, or the idea's own
# number. Note that the GitHub issues API also returns PRs, so both issues
# and PRs are fetched successfully. Skip anything the issues endpoint
# can't return (404 for discussions / self-refs) instead of failing the
# whole run; a genuine API/auth fault still surfaces via the epics query
# above (which fails fast).
gh api "repos/${REPO}/issues/${n}" --jq '{number, title, state}' 2>/dev/null \
|| { echo "::error::failed to fetch issue ${n} from ${REPO}" >&2; exit 1; }
|| echo "::notice::skipping referenced #${n} (not a fetchable issue/PR — discussion/self-ref)" >&2
done <<<"$refs" | jq -sc '.')"
fi

Expand Down
Loading