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
This commit is contained in:
@@ -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"')
|
||||
|
||||
Reference in New Issue
Block a user