Problem of typescript-action
When creating a GitHub Action, we often use the official typescript-action. While it is indeed user-friendly, there are several challenges when it comes to maintenance:
- It lacks a mechanism to keep the library up to date.
- It lacks an automatic changelogs generation feature.
- It lacks an automated version incrementation mechanism, and every release requires manually updating the major version tag.
To address the above challenges, I have created an enhanced version of typescript-action called advanced-typescript-action template.
New features in advanced-typescript-action
-
Use Vitest instead of jest
Vitest is significantly faster than jest and even faster than @swc/jest.
-
Use renovate to keep the library up to date.
Use renovate to ensure the library remains up to date with the latest versions.
-
Use changesets for automatic change log generation and version management. Changesets are automatically added to renovate pull requests.
When changesets pull requests are merged, tags are automatically applied. Major version tags are also updated automatically.
Example of normal PR
Let me explain the process of submitting a fix pull request (PR) using the current version v1.0.2
of the GitHub Action as an example.
- Make the patch fix and submit a pull request (PR).
- Add changesets to the PR (either by adding them locally using
pnpm changeset
or by clicking the link in the comment from the changeset bot within the PR - both methods are acceptable). - Merge the PR.
And then, the version of the GitHub Action will be automatically updated to v1.0.3
, and the tag v1.0.3
will be added. The v1
tag will also be updated from the commit of v1.0.2
to the commit of v1.0.3
.
Example of renovate PR
Let me explain the process of submitting a fix pull request (PR) using the current version v1.0.2
of the GitHub Action as an example.
- Renovate generates a pull request (PR) during the specified time frame.
- Patch fix changesets are automatically added to the PR.
- If the tests pass, the PR is automatically merged.
And similarly to the “Example of a normal PR”, the version of the GitHub Action will be automatically updated to v1.0.3
, and the v1.0.3
tag will be added. The v1
tag will also be updated from the commit of v1.0.2
to the commit of v1.0.3
.
If you add enough tests, the library’s version up can totally be automated.
That’s it
Hope this template helps you.
https://github.com/thundermiracle/advanced-typescript-action