-
-
Notifications
You must be signed in to change notification settings - Fork 154
39 lines (37 loc) · 1.5 KB
/
issue-assign.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Auto Assign
on:
issue_comment:
types: [created]
jobs:
assign_issues:
if: >
(github.event_name == 'issue_comment' && (
startsWith(github.event.comment.body, '/assign') ||
startsWith(github.event.comment.body, '/unassign') ||
contains(github.event.comment.body, 'assign to me') ||
contains(github.event.comment.body, 'please assign me this') ||
contains(github.event.comment.body, 'assign this to me') ||
contains(github.event.comment.body, 'assign this issue to me') ||
contains(github.event.comment.body, 'I can try fixing this') ||
contains(github.event.comment.body, 'i am interested in doing this') ||
contains(github.event.comment.body, 'I am interested in contributing'))) || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Check for issue assignees
uses: actions/github-script@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issueNumber = context.payload.issue.number;
if (issueNumber) {
const commenter = context.payload.comment.user.login;
const config = {
owner: 'avinashkranjan',
repo: 'Friday',
issue_number: issueNumber,
assignees: [commenter]
};
return github.issues.addAssignees(config);
} else {
return true;
}