|
1 | 1 | name: Auto Assign on Issue Comment |
| 2 | + |
2 | 3 | on: |
3 | 4 | issue_comment: |
4 | 5 | types: [created] |
|
8 | 9 | jobs: |
9 | 10 | auto-assign: |
10 | 11 | runs-on: ubuntu-latest |
| 12 | + environment: <secrets> # Defina o nome correto do ambiente configurado no GitHub |
11 | 13 | steps: |
12 | 14 | - name: Check comment and assign user |
13 | 15 | uses: actions/github-script@v7 |
|
22 | 24 | const repoOwner = context.repo.owner; |
23 | 25 | const repoName = context.repo.repo; |
24 | 26 | const keywords = [ |
25 | | - "assign me", |
26 | | - "can you assign this issue to me", |
27 | | - "i would like to work on this", |
28 | | - "i want to do this issue" |
| 27 | + "i would like to do this issue" |
29 | 28 | ]; |
30 | | -#17 |
31 | 29 | if (keywords.some(keyword => comment.includes(keyword))) { |
32 | 30 | if (assignedUsers.length > 0) { |
33 | 31 | const assignedUser = assignedUsers[0]; |
|
76 | 74 | - name: Reassign if "no" is replied |
77 | 75 | uses: actions/github-script@v7 |
78 | 76 | with: |
79 | | - github-token: ${{ secrets.GITHUB_TOKEN }} |
| 77 | + github-token: ${{ secrets.AUTO_ISSUE_TOKEN }} |
80 | 78 | script: | |
81 | 79 | const issue = context.payload.issue; |
82 | 80 | const comment = context.payload.comment.body.toLowerCase(); |
@@ -173,11 +171,8 @@ jobs: |
173 | 171 | const repoName = context.repo.repo; |
174 | 172 | const issueNumber = issue.number; |
175 | 173 | |
176 | | - const instructions = `To assign yourself to this issue, comment with one of the following: |
177 | | - - "assign me" |
178 | | - - "can you assign this issue to me" |
179 | | - - "i would like to work on this" |
180 | | - - "i want to do this issue" |
| 174 | + const instructions = `To assign yourself to this issue, comment with the following: |
| 175 | + - "I would like to do this issue" |
181 | 176 | If the issue is already assigned, the assigned user will be asked if they are still working on it.`; |
182 | 177 | |
183 | 178 | await github.rest.issues.createComment({ |
|
0 commit comments