Skip to content

Commit

Permalink
Change external labeler to use the GH CLI for fine-grained token supp…
Browse files Browse the repository at this point in the history
…ort (#899)

This PR rewrites the action from `graphQL` to `gh cli`. 

~Functionality should remain the same.~ Removed discussions since they're not supported by the gh cli.

Authors:
  - Ben Jarmak (https://github.com/jarmak-nv)

Approvers:
  - David Gardner (https://github.com/dagardner-nv)

URL: #899
  • Loading branch information
jarmak-nv authored Apr 21, 2023
1 parent ef303cd commit 37d134c
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions .github/workflows/label-external-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,8 @@ on:
types:
- opened

discussion:
types:
- created

env:
GITHUB_TOKEN: ${{ secrets.PROJECT_MANAGEMENT_PAT }}
# Label ID from an external graphQL query, represents 'Needs Triage'
LABEL_ID: LA_kwDOFrb0NM7yzEQv

permissions:
issues: write

jobs:
Label-Issue:
Expand All @@ -40,12 +31,5 @@ jobs:
steps:
- name: add-triage-label
run: |
gh api graphql -f query='
mutation {
addLabelsToLabelable(input: {labelableId : "${{ github.event.issue.node_id }}" ,
labelIds: [ "${{ env.LABEL_ID }}" ]
}
){
clientMutationId
}
}'
issue_url=${{ github.event.issue.html_url }}
gh issue edit ${issue_url} --add-label "Needs Triage"

0 comments on commit 37d134c

Please sign in to comment.