Files
slash-command-dispatch/.github/workflows/slash-command-dispatch.yml
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 583587f52d build(deps): bump the github-actions group with 2 updates (#434)
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [peter-evans/create-or-update-comment](https://github.com/peter-evans/create-or-update-comment).


Updates `actions/checkout` from 5 to 6
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

Updates `peter-evans/create-or-update-comment` from 4 to 5
- [Release notes](https://github.com/peter-evans/create-or-update-comment/releases)
- [Commits](https://github.com/peter-evans/create-or-update-comment/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: peter-evans/create-or-update-comment
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-01 03:03:36 +00:00

123 lines
4.3 KiB
YAML

name: Slash Command Dispatch
on:
issue_comment:
# Type "edited" added here for test purposes. Where possible, avoid
# using to prevent processing unnecessary events.
types: [created, edited]
jobs:
slashCommandDispatch:
runs-on: ubuntu-latest
steps:
# Checkout is necessary here due to referencing a local action.
# It's also necessary when using the 'config-from-file' option.
# Otherwise, avoid using checkout to keep this workflow fast.
- uses: actions/checkout@v6
# Basic configuration
- name: Slash Command Dispatch
uses: ./
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
commands: |
hello-yaml-local
hello-world-local
ping-local
permission: none
issue-type: issue
# Advanced JSON configuration
- name: Slash Command Dispatch (JSON)
id: scd
uses: ./
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
config: >
[
{
"command": "rebase",
"permission": "admin",
"repository": "peter-evans/slash-command-dispatch-processor",
"issue_type": "pull-request"
},
{
"command": "help",
"permission": "none",
"issue_type": "issue",
"repository": "peter-evans/slash-command-dispatch-processor"
},
{
"command": "help",
"permission": "none",
"issue_type": "pull-request",
"repository": "peter-evans/slash-command-dispatch-processor",
"event_type_suffix": "-pr-command"
},
{
"command": "example",
"permission": "none",
"issue_type": "issue",
"repository": "peter-evans/slash-command-dispatch-processor"
},
{
"command": "hello-world",
"permission": "none",
"issue_type": "issue",
"repository": "peter-evans/slash-command-dispatch-processor"
},
{
"command": "hello-world",
"permission": "none",
"issue_type": "pull-request",
"repository": "peter-evans/slash-command-dispatch-processor",
"event_type_suffix": "-pr-command"
},
{
"command": "hello-workflow",
"permission": "none",
"issue_type": "issue",
"repository": "peter-evans/slash-command-dispatch-processor",
"static_args": [
"repository=${{ github.repository }}",
"comment-id=${{ github.event.comment.id }}",
"issue-number=${{ github.event.issue.number }}",
"actor=${{ github.actor }}"
],
"dispatch_type": "workflow"
},
{
"command": "ping",
"permission": "none",
"issue_type": "issue",
"repository": "peter-evans/slash-command-dispatch-processor"
},
{
"command": "black",
"permission": "none",
"issue_type": "pull-request",
"repository": "peter-evans/slash-command-dispatch-processor"
},
{
"command": "reset-demo",
"permission": "none",
"issue_type": "pull-request",
"repository": "peter-evans/slash-command-dispatch-processor"
}
]
- name: Edit comment with error message
if: steps.scd.outputs.error-message
uses: peter-evans/create-or-update-comment@v5
with:
comment-id: ${{ github.event.comment.id }}
body: |
> ${{ steps.scd.outputs.error-message }}
# Advanced JSON configuration from file
# (These commands do not do anything and are just a reference example)
- name: Slash Command Dispatch (JSON file)
uses: ./
with:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
reactions: false
config-from-file: .github/slash-command-dispatch.json