-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #303 from samarsajad/assign
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Auto Assign | ||
|
||
on: | ||
issue_comment: | ||
types: [created] | ||
schedule: | ||
- cron: '0 0 * * *' | ||
workflow_dispatch: | ||
|
||
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: 'andoriyaprashant', | ||
repo: 'OpSo', | ||
issue_number: issueNumber, | ||
assignees: [commenter] | ||
}; | ||
return github.issues.addAssignees(config); | ||
} else { | ||
return true; | ||
} |