Files
DeepTutor/.github/workflows/maintainer-commands.yml

63 lines
2.3 KiB
YAML

name: Maintainer Commands
on:
issue_comment:
types: [created]
concurrency:
group: maintainer-cmd-${{ github.event.issue.number }}
cancel-in-progress: false
permissions:
contents: read
issues: write
pull-requests: write
actions: write
jobs:
dispatch:
name: Execute maintainer slash command
runs-on: ubuntu-latest
if: >-
github.event.comment.user.type != 'Bot' &&
(
contains(github.event.comment.body, '/claim') ||
contains(github.event.comment.body, '/take') ||
contains(github.event.comment.body, '/unclaim') ||
contains(github.event.comment.body, '/assign') ||
contains(github.event.comment.body, '/label') ||
contains(github.event.comment.body, '/unlabel') ||
contains(github.event.comment.body, '/need-info') ||
contains(github.event.comment.body, '/needs-info') ||
contains(github.event.comment.body, '/close') ||
contains(github.event.comment.body, '/reopen') ||
contains(github.event.comment.body, '/ci') ||
contains(github.event.comment.body, '/ok-to-test') ||
contains(github.event.comment.body, '/pancake') ||
contains(github.event.comment.body, '/escalate')
)
steps:
- name: Checkout default branch configuration
uses: actions/checkout@v4
with:
ref: ${{ github.event.repository.default_branch }}
persist-credentials: false
sparse-checkout: |
.github/maintainers.yml
.github/scripts/maintainer-commands.mjs
- name: Run maintainer command handler
run: node .github/scripts/maintainer-commands.mjs
env:
GH_TOKEN: ${{ secrets.MAINTAINER_BOT_TOKEN || github.token }}
GITHUB_REPOSITORY: ${{ github.repository }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
IS_PR: ${{ github.event.issue.pull_request != null }}
COMMENT_ID: ${{ github.event.comment.id }}
COMMENT_BODY: ${{ github.event.comment.body }}
COMMENT_USER: ${{ github.event.comment.user.login }}
ISSUE_AUTHOR: ${{ github.event.issue.user.login }}
ISSUE_HTML_URL: ${{ github.event.issue.html_url }}
ISSUE_TITLE: ${{ github.event.issue.title }}
FEISHU_ESCALATE_WEBHOOK: ${{ secrets.FEISHU_ESCALATE_WEBHOOK }}