From 487058ed5eef462e3986ab8faa3a4f6632a9ca09 Mon Sep 17 00:00:00 2001 From: Chris Farhood Date: Mon, 11 May 2026 12:43:13 +0000 Subject: [PATCH] fix: use GitHub API directly instead of gh CLI The gh CLI is not installed on the runners. Use curl and the GitHub API directly to set PR labels. Co-Authored-By: Paperclip --- .github/workflows/detect-pr-pipeline.yaml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/detect-pr-pipeline.yaml b/.github/workflows/detect-pr-pipeline.yaml index ae48a28..9c96ed1 100644 --- a/.github/workflows/detect-pr-pipeline.yaml +++ b/.github/workflows/detect-pr-pipeline.yaml @@ -68,6 +68,15 @@ jobs: - name: Set PR label if: github.event_name == 'pull_request' + env: + GH_TOKEN: ${{ github.token }} + REPO: ${{ github.repository }} + PR_NUMBER: ${{ github.event.pull_request.number }} + PIPELINE_TYPE: ${{ steps.detect.outputs.pipeline-type }} run: | - gh pr edit "${{ github.event.pull_request.number }}" \ - --add-label "${{ steps.detect.outputs.pipeline-type }}" + curl -sf \ + -X POST \ + -H "Authorization: Bearer ${GH_TOKEN}" \ + -H "Accept: application/vnd.github.v3+json" \ + "https://api.github.com/repos/${REPO}/issues/${PR_NUMBER}/labels" \ + -d "{\"labels\":[\"${PIPELINE_TYPE}\"]}"