Skip to content

Commit 3b4fdac

Browse files
authored
Merge pull request #195 from github/mbg/workflow-permissions
Add permissions to workflow
2 parents 05e07ac + bbcf258 commit 3b4fdac

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/label-issue.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ on:
66
jobs:
77
label:
88
name: Label issue
9-
runs-on: ubuntu-latest
10-
if: github.event.action == 'opened'
9+
runs-on: ubuntu-slim
10+
permissions:
11+
issues: write
1112
steps:
1213
- name: Label issue
14+
run: gh issue edit "$NUMBER" --add-label "$LABELS"
1315
env:
14-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15-
run: |
16-
echo '{"labels": ["CLI"]}' | gh api repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/labels --input -
16+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
GH_REPO: ${{ github.repository }}
18+
NUMBER: ${{ github.event.issue.number }}
19+
LABELS: CLI

0 commit comments

Comments
 (0)