diff --git a/.github/workflows/auto-assign.yml b/.github/workflows/auto-assign.yml new file mode 100644 index 0000000000..3fb7c15c9c --- /dev/null +++ b/.github/workflows/auto-assign.yml @@ -0,0 +1,28 @@ +name: Assign or Unassign via Comment + +on: + issue_comment: + types: [created] + +jobs: + assign-or-unassign: + if: | + contains(github.event.comment.body, '/assign') || + contains(github.event.comment.body, '/unassign') + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Assign if /assign + if: contains(github.event.comment.body, '/assign') + uses: actions-ecosystem/action-add-assignees@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + assignees: ${{ github.actor }} + + - name: Unassign if /unassign + if: contains(github.event.comment.body, '/unassign') + uses: actions-ecosystem/action-remove-assignees@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + assignees: ${{ github.actor }} \ No newline at end of file