|
| 1 | +name: Auto Assign |
| 2 | + |
| 3 | +on: |
| 4 | + issue_comment: |
| 5 | + types: [created] |
| 6 | + schedule: |
| 7 | + - cron: '0 0 * * *' # Runs daily at midnight |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +jobs: |
| 11 | + assign_issues: |
| 12 | + if: > |
| 13 | + (github.event_name == 'issue_comment' && ( |
| 14 | + startsWith(github.event.comment.body, '/assign') || |
| 15 | + startsWith(github.event.comment.body, '/unassign') || |
| 16 | + contains(github.event.comment.body, 'assign to me') || |
| 17 | + contains(github.event.comment.body, 'please assign me this') || |
| 18 | + contains(github.event.comment.body, 'assign this to me') || |
| 19 | + contains(github.event.comment.body, 'assign this issue to me') || |
| 20 | + contains(github.event.comment.body, 'I can try fixing this') || |
| 21 | + contains(github.event.comment.body, 'i am interested in doing this') || |
| 22 | + contains(github.event.comment.body, 'I am interested in contributing'))) || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' |
| 23 | + runs-on: ubuntu-latest |
| 24 | + steps: |
| 25 | + - name: Check for issue assignees |
| 26 | + uses: actions/github-script@v4 |
| 27 | + with: |
| 28 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 29 | + script: | |
| 30 | + const issueNumber = context.payload.issue.number; |
| 31 | + if (issueNumber) { |
| 32 | + const commenter = context.payload.comment.user.login; |
| 33 | + const config = { |
| 34 | + owner: 'avinashkranjan', |
| 35 | + repo: 'Pentesting-and-Hacking-Scripts', |
| 36 | + issue_number: issueNumber, |
| 37 | + assignees: [commenter] |
| 38 | + }; |
| 39 | + return github.issues.addAssignees(config); |
| 40 | + } else { |
| 41 | + return true; |
| 42 | + } |
0 commit comments