Skip to content

Commit

Permalink
feat: combine slash command jobs into single job steps (#266)
Browse files Browse the repository at this point in the history
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Aaron <AJ> Steers <[email protected]>
  • Loading branch information
devin-ai-integration[bot] and aaronsteers authored Jan 24, 2025
1 parent 4ea9d94 commit b1824c6
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions .github/workflows/slash_command_dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ jobs:
# Only allow slash commands on pull request (not on issues)
if: ${{ github.event.issue.pull_request }}
runs-on: ubuntu-24.04
outputs:
error-message: ${{ steps.dispatch.outputs.error-message }}
command: ${{ steps.dispatch.outputs.command }}
steps:
- name: Slash Command Dispatch
id: dispatch
uses: peter-evans/slash-command-dispatch@v4
# TODO: Revert to `peter-evans/slash-command-dispatch@v4` after PR merges:
# - https://github.com/peter-evans/slash-command-dispatch/pull/372/files
uses: aaronsteers/slash-command-dispatch@aj/fix/add-dispatched-bool-output
with:
repository: ${{ github.repository }}
token: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }}
Expand All @@ -40,17 +39,11 @@ jobs:
body: |
> Error: ${{ steps.dispatch.outputs.error-message }}
unrecognizedSlashCommand:
needs: slashCommandDispatch
if: >
github.event.issue.pull_request &&
startsWith(github.event.comment.body, '/') &&
!needs.slashCommandDispatch.outputs.command &&
!needs.slashCommandDispatch.outputs.error-message
runs-on: ubuntu-24.04
steps:
- name: Generate help text
id: help
if: >
startsWith(github.event.comment.body, '/') &&
!steps.dispatch.outputs.dispatched
run: |
HELP_TEXT="The following slash commands are available:
Expand All @@ -68,6 +61,9 @@ jobs:
fi
- name: Post help message
if: >
startsWith(github.event.comment.body, '/') &&
!steps.dispatch.outputs.dispatched
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ github.event.comment.id }}
Expand Down

0 comments on commit b1824c6

Please sign in to comment.