Skip to content

Commit aa9d0db

Browse files
authored
Create auto-assign-issue.yml
1 parent ab6b54c commit aa9d0db

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
name: Assign issue to comment author
3+
on:
4+
issue_comment:
5+
types: [created]
6+
jobs:
7+
assign-issue:
8+
if: |
9+
contains(github.event.comment.body, '/assign') || contains(github.event.comment.body, '/accept') &&
10+
!contains(github.event.comment.user.login, 'openimbot') &&
11+
!contains(github.event.comment.user.login, 'kubbot')
12+
runs-on: ubuntu-latest
13+
permissions:
14+
issues: write
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Assign the issue
20+
run: |
21+
export LETASE_MILESTONES=$(curl 'https://api.github.com/repos/$OWNER/$PEPO/milestones' | jq -r 'last(.[]).title')
22+
gh issue edit ${{ github.event.issue.number }} --add-assignee "${{ github.event.comment.user.login }}"
23+
gh issue edit ${{ github.event.issue.number }} --add-label "triage/accepted"
24+
gh issue edit ${{ github.event.issue.number }} --milestone "$LETASE_MILESTONES"
25+
gh issue comment $ISSUE --body "@${{ github.event.comment.user.login }} Glad to see you accepted this issue🤲, this issue has been assigned to you. I set the milestones for this issue to [$LETASE_MILESTONES](https://github.com/$OWNER/$PEPO/milestones), We are looking forward to your PR!"
26+
env:
27+
GH_TOKEN: ${{ secrets.REDBOT_GITHUB_TOKEN }}
28+
ISSUE: ${{ github.event.issue.html_url }}
29+
OWNER: ${{ github.repository_owner }}

0 commit comments

Comments
 (0)