Skip to content

Commit

Permalink
ci: hotfix: slash command token, add error comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsteers committed Mar 28, 2024
1 parent 3e5cc4b commit 5238c64
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/slash_command_dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,32 @@ env:

jobs:
slashCommandDispatch:
# Only allow slash commands on pull request (not on issues)
if: ${{ github.event.issue.pull_request }}
runs-on: ubuntu-latest
steps:

- name: Slash Command Dispatch
id: dispatch
uses: peter-evans/slash-command-dispatch@v4
with:
repository: ${{ github.repository }}
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GH_PAT_MAINTENANCE_OCTAVIA }}
issue-type: pull-request
commands: |
autofix
test-pr
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@v1
with:
comment-id: ${{ github.event.comment.id }}
body: |
> Error: ${{ steps.dispatch.outputs.error-message }}
4 changes: 4 additions & 0 deletions .github/workflows/test-pr-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
description: 'PR Number'
type: number
required: true
comment-id:
description: 'Comment ID (Optional)'
type: string
required: false

env:
AIRBYTE_ANALYTICS_ID: ${{ vars.AIRBYTE_ANALYTICS_ID }}
Expand Down

0 comments on commit 5238c64

Please sign in to comment.