Repository navigation
56 lines (52 loc) · 2.1 KB
/
Copy pathslash-command-dispatch.yml
File metadata and controls
56 lines (52 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Slash Command Dispatch
# Routes `/<command>` comments on issues and PRs to dedicated handler
# workflows via repository_dispatch events. Uses peter-evans/slash-command-
# dispatch so we get:
# - Current repository permission checks (write, maintain, or admin)
# - Reactions on the triggering comment (eyes on ack, +1 on success, -1 on fail)
# - Clean separation: this workflow routes, downstream handlers do the work
#
# Required repo secrets:
# IPR_APP_ID / IPR_APP_PRIVATE_KEY — existing AAO IPR Bot App installation.
# The repository-scoped App token needs contents:write for dispatch and
# pull-requests:read for PR context. The job token adds comment reactions.
#
# Current commands:
# /triage [modifier] — fire the triage routine on this issue. Modifiers
# bias the outcome (execute / clarify / defer).
on:
issue_comment:
types: [created]
permissions:
issues: write # Reactions on issue and PR comments.
jobs:
dispatch:
name: Dispatch slash command
runs-on: ubuntu-latest
timeout-minutes: 2
# Mint credentials only for human-authored /triage command candidates.
if: >-
github.event.comment.user.type != 'Bot' &&
!endsWith(github.event.comment.user.login, '[bot]') &&
startsWith(github.event.comment.body, '/triage')
steps:
- name: Mint repository dispatch App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.IPR_APP_ID }}
private-key: ${{ secrets.IPR_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: adcp-client-python
permission-contents: write
permission-pull-requests: read
- name: Slash command dispatch
uses: peter-evans/slash-command-dispatch@9bdcd7914ec1b75590b790b844aa3b8eee7c683a # v5.0.2
with:
token: ${{ steps.app-token.outputs.token }}
reaction-token: ${{ github.token }}
commands: |
triage
permission: write
reactions: true
issue-type: both