Typescript action template with basic setup for GitHub Actions + release.
- Format uses Prettier. Setup your editor to format on save with prettier.
- Lint uses ESLint. Setup your editor to enable eslint flat.
// .vscode/settings.json
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always"
},
"eslint.useFlatConfig": true
}- make sure to setup pnpm
- update
package.jsonwith your action name, description, author, license, etc. - update action metadata in
action.yml - add your logic in
src/ - this repo is trunk based, so you can open any PR directly against
mainbranch. On merge, it will be automatically released. - typescript is built using unbuild. Check their repository README for details. Extra configuration can be done in
unbuild.config.tsas needed. - tests are run using vitest. You can add your tests in
src/__tests__/. The test command ispnpm test. - remember to update the readme as well, so users know how to use your action.
Warning
It might be necessary to make the repository public to use it in GitHub Actions, as private repositories need special permissions that we do not have for now.
Releases are automatically created when a push is made to main (recommended to be made through pull requests). The release will be tagged and a changelog will be generated based on the commit messages.
A few packages are included by default to help with development:
tsx- to run typescript files directly (i.e.pnpm tsx src/file.ts)execa- to run shell commands in a cross-platform way (see docs: execa)@actions/core- to interact with GitHub Actions@actions/github- to interact with GitHub API@actions/exec- to run shell commands in GitHub Actions
Claude code config is not included by default, but we recommend you can add it to your project if you want to use AI features with the cli by calling /init.