A template for creating a GitHub Action using TypeScript with advanced features to make your Github Action life easier.
Official template of creating Github Action is very convenient, but not enough.
We should test it before release. Keeping the dependencies of Github Action up to date. Release it with readable changelogs. And of course, to let users use it more easily, creating correct tags is required.
All these chores are repetitive and boring without automation. So I created this template and hope it can help you too.
Using Vitest to test the Github Action. It will run automatically when you push to the repository by CI workflow test.yml
.
Using changesets
to manage the version of Github Action. It will create a PR with a changelog. After pr merged, it will create a tag. All these steps have already been included in the CI workflow release.yml
.
Using renovate to keep the dependencies up to date. It will automatically create a PR when the dependencies updated once a month.
Furthermore, CI workflow renovate-changesets.yml
will automatically push a commit for changesets
when renovate creates a PR. Very convenient!
changesets
will create the tags based on semver. But we usually want to create a tag with only major like v1
to let users keep using the latest version.
CI workflow tag-update.yml
will automatically re-tag the latest commit with major version when changesets
creates a tag. For example, if changesets
creates a tag v1.2.3
, tag-update.yml
will remove the latest v1
and re-tag the latest commit with v1
where tag v1.2.3
points to.
Create a Personal access token with repo
& workflow
scope and add it to the repository secrets with name PAT_GITHUB
.
That's all! Now you can start to develop your Github Action.
The scripts and documentation in this project are released under the MIT License