* feat: support yml or yaml (#427) test: support yml or yaml chore: lint * Fix getting permissions for the contributors who are a part of the team (#424) * Fix getActorPermission to handle team-based permissions * Use 'user.permissions' object to return permission * Add RepoPermission type * Make new build * feat: update runtime to node 24 * fix: eslint-plugin dep * fix: remove unused type * docs: update whats new --------- Co-authored-by: Patrick Lee Scott <[email protected]> Co-authored-by: Volodymyr Zotov <[email protected]>
3.0 KiB
Getting started
Follow this guide to get started with a working /example command.
Command processing setup
-
Create a new repository called, for example,
slash-command-processor. This will be the repository that commands are dispatched to for processing. -
In your new repository, create the following workflow at
.github/workflows/example-command.yml.name: example-command on: repository_dispatch: types: [example-command] jobs: example: runs-on: ubuntu-latest steps: - name: Add reaction uses: peter-evans/create-or-update-comment@v5 with: token: ${{ secrets.PAT }} repository: ${{ github.event.client_payload.github.payload.repository.full_name }} comment-id: ${{ github.event.client_payload.github.payload.comment.id }} reactions: hooray -
Create a
reposcoped Personal Access Token (PAT) by following this guide. -
Go to your repository
Settings->Secrets and variables->ActionsandNew repository secret.Name:
PATValue: (The PAT created in step 3)
Command processing setup is complete! Now we need to setup command dispatch for our /example command.
Command dispatch setup
-
Choose a repository or create a new repository to dispatch commands from. This will be the repository where issue and pull request comments will be monitored for slash commands.
In the repository, create the following workflow at
.github/workflows/slash-command-dispatch.yml.Note: Change
your-github-username/slash-command-processorto reference your command processor repository created in the previous section.name: Slash Command Dispatch on: issue_comment: types: [created] jobs: slashCommandDispatch: runs-on: ubuntu-latest steps: - name: Slash Command Dispatch uses: peter-evans/slash-command-dispatch@v5 with: token: ${{ secrets.PAT }} commands: example repository: your-github-username/slash-command-processor -
Create a new
reposcoped PAT, OR, use the one created at step 3 of the previous section. -
Go to your repository
Settings->SecretsandAdd a new secret.Name:
PATValue: (The PAT created in step 2)
Command dispatch setup is complete! Now let's test our /example command.
Testing the command
-
Create a new GitHub Issue in the repository you chose to dispatch commands from.
-
Add a new comment with the text
/example.
Once the command completes you should see all three reactions on your comment.
Now you can start to tweak the command and make it do something useful!
