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 <noreply@paperclip.ing>
This commit is contained in:
@@ -68,6 +68,15 @@ jobs:
|
|||||||
|
|
||||||
- name: Set PR label
|
- name: Set PR label
|
||||||
if: github.event_name == 'pull_request'
|
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: |
|
run: |
|
||||||
gh pr edit "${{ github.event.pull_request.number }}" \
|
curl -sf \
|
||||||
--add-label "${{ steps.detect.outputs.pipeline-type }}"
|
-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}\"]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user