-
Notifications
You must be signed in to change notification settings - Fork 4.2k
45 lines (43 loc) · 1.5 KB
/
slash-commands.yml
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
name: Slash Command Dispatch
on:
issue_comment:
types: [created]
jobs:
slashCommandDispatch:
# Only allow slash commands on pull request (not on issues)
if: ${{ github.event.issue.pull_request }}
runs-on: ubuntu-24.04
steps:
- name: Get PR repo and ref
id: getref
run: |
pr_info="$(curl ${{ github.event.issue.pull_request.url }})"
echo ref="$(echo $pr_info | jq -r '.head.ref')" >> $GITHUB_OUTPUT
echo repo="$(echo $pr_info | jq -r '.head.repo.full_name')" >> $GITHUB_OUTPUT
- name: Slash Command Dispatch (Workflow)
id: scd
uses: peter-evans/slash-command-dispatch@v3
with:
token: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }}
permission: write
commands: |
bump-version
format-fix
test
test-performance
publish-java-cdk
connector-performance
approve-regression-tests
static-args: |
repo=${{ steps.getref.outputs.repo }}
gitref=${{ steps.getref.outputs.ref }}
comment-id=${{ github.event.comment.id }}
pr=${{ github.event.issue.number }}
dispatch-type: workflow
- name: Edit comment with error message
if: steps.scd.outputs.error-message
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ github.event.comment.id }}
body: |
> Error: ${{ steps.scd.outputs.error-message }}