如何确保“pre-commit autoupdate”定期运行?

huangapple go评论56阅读模式
英文:

How do I make sure that “pre-commit autoupdate” gets run periodically?

问题

我知道我应该定期检查 pre-commit 钩子的更新,但我很少考虑运行 pre-commit autoupdate。我最终使用过时的 pre-commit 钩子数个月。

pre-commit.ci 会自动运行 pre-commit autoupdate,如果找到更新,会提交拉取请求,但它仅支持托管在 GitHub 上的仓库,而我的很多仓库并不托管在 GitHub 上。

如何确保我的 pre-commit 钩子保持更新?

英文:

I know that I should check for pre-commit hook updates from time to time, but I rarely think about running pre-commit autoupdate. I end up using out-of-date pre-commit hooks for months.

pre-commit.ci will automatically run pre-commit autoupdate and submit pull requests if updates are found, but it only supports repos hosted on GitHub, and a lot of my repos aren’t hosted on GitHub.

How can I make sure that my pre-commit hooks stay up to date?

答案1

得分: 1

你可以使用 crontab 定期自动更新它。您可以参考这个问题中的类似解决方案。

英文:

You can use a crontab to automatically update it for you on a regular basis. You can take a look at a similar solution in this question.

答案2

得分: 1

Check out pre-commit-update, it can be configured as a pre-commit hook itself so you will never have to worry about manually updating the hooks 如何确保“pre-commit autoupdate”定期运行?

Also, it is very configurable.

英文:

Check out pre-commit-update, it can be configured as a pre-commit hook itself so you will never have to worry about manually updating the hooks 如何确保“pre-commit autoupdate”定期运行?

Also, it is very configurable.

huangapple
  • 本文由 发表于 2023年3月4日 00:12:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/75629444.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定