Skip to content

Commit

Permalink
chore: add an issue bot
Browse files Browse the repository at this point in the history
Signed-off-by: Phoeniix Zhao <[email protected]>
  • Loading branch information
Phoenix500526 authored and mergify[bot] committed Mar 27, 2024
1 parent d4424cd commit 89c2c61
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/issue-cmds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
on:
issue_comment:
types:
- created

jobs:
assignme:
name: /assignme
runs-on: ubuntu-latest
if: startsWith(github.event.comment.body, '/assignme')

steps:
- uses: xt0rted/slash-command-action@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
command: assignme
reaction: "true"
reaction-type: "rocket"
permission-level: read

- uses: actions-ecosystem/action-add-assignees@v1
with:
github_token: ${{ secrets.github_token }}
assignees: ${{ github.actor }}

help:
name: /help
runs-on: ubuntu-latest
if: startsWith(github.event.comment.body, '/help')

steps:
- uses: xt0rted/slash-command-action@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
command: help
reaction: "true"
reaction-type: "rocket"

- uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.issue.number }}
body: |
Get help or engage by:
- `/help` : to print help messages.
- `/assignme` : to assign this issue to you.
21 changes: 21 additions & 0 deletions .github/workflows/issue-welcome.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on:
issues:
types:
- opened

# https://github.com/marketplace/actions/create-or-update-comment

jobs:
welcome:
runs-on: ubuntu-latest
steps:
- uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.issue.number }}
body: |
👋 Thanks for opening this issue!
Reply with the following command on its own line to get help or engage:
- `/help` : to print help messages.
- `/assignme` : to assign this issue to you.

0 comments on commit 89c2c61

Please sign in to comment.