-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (47 loc) · 1.55 KB
/
Copy pathslash-command-dispatch.yml
File metadata and controls
53 lines (47 loc) · 1.55 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
name: Slash Command Dispatch
on:
issue_comment:
types: [created]
permissions:
contents: read
issues: write
pull-requests: write
actions: write
jobs:
slashCommandDispatch:
# Only allow slash commands on pull request (not on issues)
if: ${{ github.event.issue.pull_request }}
runs-on: ubuntu-latest
steps:
- name: Authenticate as GitHub App (if available)
uses: actions/create-github-app-token@v2
id: get-app-token
continue-on-error: true
with:
app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }}
private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }}
- name: Slash Command Dispatch
id: dispatch
uses: peter-evans/slash-command-dispatch@v5
with:
repository: ${{ github.repository }}
token: ${{ steps.get-app-token.outputs.token || secrets.GITHUB_TOKEN }}
dispatch-type: workflow
issue-type: pull-request
commands: |
autofix
lock
poe
prerelease
static-args: |
pr=${{ github.event.issue.number }}
comment-id=${{ github.event.comment.id }}
# Only run for users with 'write' permission on the main repository
permission: write
- name: Edit comment with error message
if: steps.dispatch.outputs.error-message
uses: peter-evans/create-or-update-comment@v5
with:
comment-id: ${{ github.event.comment.id }}
body: |
> Error: ${{ steps.dispatch.outputs.error-message }}