Introduce linters for GitHub Actions
I got this idea after seeing #4932. If this is already on your roadmap, please feel free to ignore it.
Managing GitHub Actions has its pitfalls. To help avoid known vulnerabilities, would we consider introducing linters?
The following tools are well-maintained and widely used:
- [actionlint](https://github.com/rhysd/actionlint)
- [ghalint](https://github.com/suzuki-shunsuke/ghalint)
- [zizmor](https://github.com/zizmorcore/zizmor)
- [pinact](https://github.com/suzuki-shunsuke/pinact)
- Technically not a linter, but useful for pinning and updating action version hashes.
While their rules overlap somewhat, they don't conflict with each other, so, in my opinion, I suggest adopting all of them.
For tool management, I think it would be good to use `mise` with the existing `.tool-versions` or `mise.toml`. This ensures we use the exact same tool versions across both CI and local development environments[^1].
Additionally, since this setup is common, it might be useful to manage it via [Reusable workflows](https://docs.github.com/en/actions/concepts/workflows-and-actions/reusing-workflow-configurations) at the Organization level.
[^1]: For context, BarryThePenguin appears to have personally been using mise for some time: https://github.com/honojs/middleware/pull/1366#issue-3298431440
5 条评论