Skip to content

Commit bf83d7b

Browse files
rayketchamclaude
andcommitted
ci(release): use curl instead of gh CLI for verify-ci gate (#103)
v0.9.2 tag push hit `gh: command not found` on the Rocky runner that picked up the release job — the verify-ci preflight introduced in #98 calls `gh api`, but `gh` is not installed across every self-hosted Linux label. Rewrite the check with `curl + jq`; both are already dependencies elsewhere in the release pipeline. This leaves the security posture unchanged: the gate still aborts the release if the latest CI run on the tagged SHA has any conclusion other than `success`. It just no longer fails-open when the runner lacks an optional CLI. Fixes #103. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent c6e3bc9 commit bf83d7b

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,17 @@ jobs:
2727
run: |
2828
set -euo pipefail
2929
echo "Checking CI status for $REPO @ $SHA"
30-
# Take the most recent completed CI.yml run on the exact commit SHA.
31-
status=$(gh api "repos/${REPO}/actions/workflows/ci.yml/runs?head_sha=${SHA}&per_page=1" \
32-
--jq '.workflow_runs[0] | {status: .status, conclusion: .conclusion, html_url: .html_url}')
33-
echo "$status"
34-
conclusion=$(echo "$status" | jq -r '.conclusion // "missing"')
30+
# Use curl + jq (always present on self-hosted runners) — avoids
31+
# a hard dep on the gh CLI, which is not installed on every
32+
# [self-hosted, Linux] label in our fleet (see release run
33+
# 24915505204 where the gate died with `gh: command not found`).
34+
response=$(curl -fsS \
35+
-H "Authorization: Bearer ${GH_TOKEN}" \
36+
-H "Accept: application/vnd.github+json" \
37+
-H "X-GitHub-Api-Version: 2022-11-28" \
38+
"https://api.github.com/repos/${REPO}/actions/workflows/ci.yml/runs?head_sha=${SHA}&per_page=1")
39+
echo "$response" | jq '.workflow_runs[0] | {status, conclusion, html_url}'
40+
conclusion=$(echo "$response" | jq -r '.workflow_runs[0].conclusion // "missing"')
3541
if [[ "$conclusion" != "success" ]]; then
3642
echo "::error::CI has not passed on ${SHA}: conclusion=${conclusion}. Aborting release."
3743
exit 1

0 commit comments

Comments
 (0)