2020 {"name": "bounty", "color": "0e8a16", "description": "Participation in the Bounty Program"}
2121 ]
2222
23+ permissions : {}
24+
2325jobs :
2426 guard-against-unauthorized-use :
27+ name : Guard against unauthorized use
28+ permissions :
29+ issues : write # required to post a comment on the issue/PR
30+ pull-requests : write # required to post a comment on the issue/PR if it's a PR
2531 if : >
26- github.actor != (' aeworxet' || ' thulieblack' ) &&
32+ !contains(fromJSON('[" aeworxet"," thulieblack"]'), github.actor ) &&
2733 (
2834 startsWith(github.event.comment.body, '/bounty' )
2935 )
3642 env :
3743 ACTOR : ${{ github.actor }}
3844 with :
39- github-token : ${{ secrets.GH_TOKEN }}
45+ github-token : ${{ github.token }}
4046 script : |
4147 const commentText = `❌ @${process.env.ACTOR} is not authorized to use the Bounty Program's commands.
4248 These commands can only be used by members of the [Bounty Team](https://github.com/orgs/asyncapi/teams/bounty_team).`;
@@ -50,19 +56,22 @@ jobs:
5056 })
5157
5258 add-label-bounty :
59+ name : Add bounty label
60+ permissions :
61+ issues : write # required to read/create labels and add labels on the issue/PR
62+ pull-requests : write # required to read/create labels and add labels on the issue/PR
5363 if : >
54- github.actor == (' aeworxet' || ' thulieblack' ) &&
64+ contains(fromJSON('[" aeworxet"," thulieblack"]'), github.actor ) &&
5565 (
5666 startsWith(github.event.comment.body, '/bounty' )
5767 )
5868
5969 runs-on : ubuntu-latest
60-
6170 steps :
6271 - name : Add label `bounty`
6372 uses : actions/github-script@v7
6473 with :
65- github-token : ${{ secrets.GH_TOKEN }}
74+ github-token : ${{ github.token }}
6675 script : |
6776 const BOUNTY_PROGRAM_LABELS = JSON.parse(process.env.BOUNTY_PROGRAM_LABELS_JSON);
6877 let LIST_OF_LABELS_FOR_REPO = await github.rest.issues.listLabelsForRepo({
@@ -91,19 +100,21 @@ jobs:
91100 })
92101
93102 remove-label-bounty :
103+ name : Remove bounty label
104+ permissions :
105+ issues : write # required to read/remove labels on the issue/PR
106+ pull-requests : write # required to read/remove labels on the issue/PR if it's a PR
94107 if : >
95- github.actor == (' aeworxet' || ' thulieblack' ) &&
108+ contains(fromJSON('[" aeworxet"," thulieblack"]'), github.actor ) &&
96109 (
97110 startsWith(github.event.comment.body, '/unbounty' )
98111 )
99-
100112 runs-on : ubuntu-latest
101-
102113 steps :
103114 - name : Remove label `bounty`
104115 uses : actions/github-script@v7
105116 with :
106- github-token : ${{ secrets.GH_TOKEN }}
117+ github-token : ${{ github.token }}
107118 script : |
108119 const BOUNTY_PROGRAM_LABELS = JSON.parse(process.env.BOUNTY_PROGRAM_LABELS_JSON);
109120 let LIST_OF_LABELS_FOR_ISSUE = await github.rest.issues.listLabelsOnIssue({
0 commit comments