From 950af300bfd969faf32a8f3e43a5497f38008f02 Mon Sep 17 00:00:00 2001 From: Hugh Hackman Date: Sun, 22 Mar 2026 04:45:20 +0000 Subject: [PATCH] fix: replace gh api with curl in dual-approval-check workflow The gh CLI is not installed on the self-hosted ARC runners (runners-privilegedescalation). Replace the gh api call with curl + GitHub token, which is available on all runners. Fixes: https://github.com/privilegedescalation/.github/issues/50 Unblocks: headlamp-polaris-plugin PR #98 and v1.0.0 release pipeline --- .github/workflows/dual-approval-check.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dual-approval-check.yaml b/.github/workflows/dual-approval-check.yaml index 324ce4a..1c88029 100644 --- a/.github/workflows/dual-approval-check.yaml +++ b/.github/workflows/dual-approval-check.yaml @@ -53,7 +53,10 @@ jobs: echo "Checking approvals on PR #${PR_NUMBER} in ${REPO}" - REVIEWS=$(gh api "repos/${REPO}/pulls/${PR_NUMBER}/reviews" 2>&1) + REVIEWS=$(curl -sf \ + -H "Authorization: Bearer ${GH_TOKEN}" \ + -H "Accept: application/vnd.github.v3+json" \ + "https://api.github.com/repos/${REPO}/pulls/${PR_NUMBER}/reviews") CTO_APPROVED=$(echo "${REVIEWS}" | jq -r --arg user "${CTO_REVIEWER}" \ '[.[] | select(.user.login == $user)] | last | .state == "APPROVED"')