|
4 | 4 | issue_comment: |
5 | 5 | types: [created] |
6 | 6 |
|
| 7 | +permissions: |
| 8 | + contents: read |
| 9 | + issues: write |
| 10 | + pull-requests: write |
| 11 | + |
7 | 12 | jobs: |
8 | 13 | slashCommandDispatch: |
9 | 14 | runs-on: ubuntu-24.04 |
|
18 | 23 | private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }} |
19 | 24 | - name: Slash Command Dispatch |
20 | 25 | id: dispatch |
21 | | - # TODO: Revert to `peter-evans/slash-command-dispatch@v4` after PR merges: |
22 | | - # - https://github.com/peter-evans/slash-command-dispatch/pull/372/files |
23 | | - uses: aaronsteers/slash-command-dispatch@aj/fix/add-dispatched-bool-output |
| 26 | + uses: peter-evans/slash-command-dispatch@v4 |
24 | 27 | with: |
25 | 28 | repository: ${{ github.repository }} |
26 | 29 | token: ${{ steps.get-app-token.outputs.token }} |
|
52 | 55 | comment-id: ${{ github.event.comment.id }} |
53 | 56 | body: | |
54 | 57 | > Error: ${{ steps.dispatch.outputs.error-message }} |
55 | | -
|
56 | | - - name: Generate help text |
57 | | - id: help |
58 | | - if: > |
59 | | - startsWith(github.event.comment.body, '/') && |
60 | | - !steps.dispatch.outputs.dispatched |
61 | | - run: | |
62 | | - HELP_TEXT="The following slash commands are available: |
63 | | -
|
64 | | - - \`/autofix\` - Corrects any linting or formatting issues |
65 | | - - \`/test\` - Runs the test suite |
66 | | - - \`/poetry-lock\` - Re-locks dependencies and updates the poetry.lock file |
67 | | - - \`/prerelease\` - Triggers a prerelease publish with default arguments |
68 | | - - \`/help\` - Shows this help message" |
69 | | -
|
70 | | - if [[ "${{ github.event.comment.body }}" == "/help" ]]; then |
71 | | - echo "body=$HELP_TEXT" >> $GITHUB_OUTPUT |
72 | | - else |
73 | | - echo "body=It looks like you are trying to enter a slash command. Either the slash command is unrecognized or you don't have access to call it. |
74 | | -
|
75 | | - $HELP_TEXT" >> $GITHUB_OUTPUT |
76 | | - fi |
77 | | -
|
78 | | - - name: Post help message |
79 | | - if: > |
80 | | - startsWith(github.event.comment.body, '/') && |
81 | | - !steps.dispatch.outputs.dispatched |
82 | | - uses: peter-evans/create-or-update-comment@v4 |
83 | | - with: |
84 | | - comment-id: ${{ github.event.comment.id }} |
85 | | - body: ${{ steps.help.outputs.body }} |
0 commit comments