File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Slash Command Dispatch
2+
3+ on :
4+ issue_comment :
5+ types : [created]
6+
7+ permissions :
8+ contents : read
9+ issues : write
10+ pull-requests : write
11+ actions : write
12+
13+ jobs :
14+ slashCommandDispatch :
15+ # Only allow slash commands on pull request (not on issues)
16+ if : ${{ github.event.issue.pull_request }}
17+ runs-on : ubuntu-latest
18+ steps :
19+ - name : Authenticate as GitHub App
20+ uses : actions/create-github-app-token@v2
21+ id : get-app-token
22+ with :
23+ app-id : ${{ secrets.OCTAVIA_BOT_APP_ID }}
24+ private-key : ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }}
25+
26+ - name : Slash Command Dispatch
27+ id : dispatch
28+ uses : peter-evans/slash-command-dispatch@v5
29+ with :
30+ repository : ${{ github.repository }}
31+ token : ${{ steps.get-app-token.outputs.token }}
32+ dispatch-type : workflow
33+ issue-type : pull-request
34+ commands : |
35+ terraform-examples
36+ static-args : |
37+ pr=${{ github.event.issue.number }}
38+ comment-id=${{ github.event.comment.id }}
39+
40+ # Only run for users with 'write' permission on the main repository
41+ permission : write
42+
43+ - name : Edit comment with error message
44+ if : steps.dispatch.outputs.error-message
45+ uses : peter-evans/create-or-update-comment@v5
46+ with :
47+ comment-id : ${{ github.event.comment.id }}
48+ body : |
49+ > Error: ${{ steps.dispatch.outputs.error-message }}
You can’t perform that action at this time.
0 commit comments