Action inputs
Name | Description |
---|---|
GITHUB_TOKEN |
A repo scoped GitHub Personal Access Token. |
prefix |
Comment must start with this value, eg: @bot |
trigger |
The text in the comment to trigger the repository dispatch, eg deploy |
event_type |
The custom event_type to send with when triggering the repository dispatch |
- uses: stewart42/action-comment-dispatch@main
with:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
prefix: 'bot'
trigger: 'format'
event_type: 'format'
This action creates repository_dispatch
events.
The default GITHUB_TOKEN
does not have scopes to do this so a repo
scoped PAT created on a user with write
access to the target repository is required. If you will be dispatching to a public repository then you can use the more limited public_repo
scope.
Install the dependencies
npm install
Build the typescript and package it for distribution
npm run build && npm run package
Run the tests ✔️
npm test
PASS ./index.test.js
✓ throws invalid number (3ms)
✓ wait 500 ms (504ms)
✓ test runs (95ms)
...
See the toolkit documentation for the various packages.
Actions are run from GitHub repos so we will checkin the packed dist folder.
Then run ncc and push the results:
npm run package
git add dist
git commit -a -m "prod dependencies"
git push origin releases/v1
Your action is now published! 🚀
See the versioning documentation
You can now validate the action by referencing ./
in a workflow in your repo (see test.yml)
uses: ./
with:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
prefix: 'bot'
trigger: 'format'
event_type: 'format'
See the actions tab for runs of this action! 🚀