Skip to content

Commit d735a74

Browse files
committed
feat:auto-assign worklow - fixes BuildCLI#107
1 parent 29daa08 commit d735a74

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

.github/workflows/auto-assign.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Auto Assign on Issue Comment
2+
23
on:
34
issue_comment:
45
types: [created]
@@ -8,6 +9,7 @@ on:
89
jobs:
910
auto-assign:
1011
runs-on: ubuntu-latest
12+
environment: <secrets> # Defina o nome correto do ambiente configurado no GitHub
1113
steps:
1214
- name: Check comment and assign user
1315
uses: actions/github-script@v7
@@ -22,12 +24,8 @@ jobs:
2224
const repoOwner = context.repo.owner;
2325
const repoName = context.repo.repo;
2426
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"
2928
];
30-
#17
3129
if (keywords.some(keyword => comment.includes(keyword))) {
3230
if (assignedUsers.length > 0) {
3331
const assignedUser = assignedUsers[0];
@@ -76,7 +74,7 @@ jobs:
7674
- name: Reassign if "no" is replied
7775
uses: actions/github-script@v7
7876
with:
79-
github-token: ${{ secrets.GITHUB_TOKEN }}
77+
github-token: ${{ secrets.AUTO_ISSUE_TOKEN }}
8078
script: |
8179
const issue = context.payload.issue;
8280
const comment = context.payload.comment.body.toLowerCase();
@@ -173,11 +171,8 @@ jobs:
173171
const repoName = context.repo.repo;
174172
const issueNumber = issue.number;
175173
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"
181176
If the issue is already assigned, the assigned user will be asked if they are still working on it.`;
182177
183178
await github.rest.issues.createComment({

0 commit comments

Comments
 (0)