Repository navigation
ci: PR 检查加 merge_group 触发,加 zizmor 和 Dependabot - #3
Merged
Merged
Conversation
push 和 merge_group 下要查的只剩 GitHub 生成的 squash 提交,作者邮箱由贡献者账号设置决定,查了会让合并队列和 main 无端变红。 Refs ModAVD/ModAVD#127
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
为以后把 CI 设成合并门槛、开合并队列做准备,同时给 workflow 加自动安全检查和依赖更新。
Refs ModAVD/ModAVD#127
改了什么
1. 触发统一
ci.yml的触发改成pull_request、push(只限main)、merge_group、workflow_dispatch。作者检查只在pull_request和workflow_dispatch下跑:PR 里的提交在 PR 阶段已经查过,push/merge_group下剩下要查的只有 GitHub 生成的 squash 提交,它的作者邮箱取自贡献者 GitHub 账号的设置(main 上已经有一个这样的提交用的不是 noreply 邮箱),查了会让合并队列和 main 无端变红。2. workflow 安全检查(zizmor)
ci.yml里新加一个 jobWorkflow security (zizmor):pip installzizmor 1.32.0,版本和 wheel 的 SHA-256 都钉死(--require-hashes --only-binary=:all:),不用第三方 action。.github/workflows和.github/dependabot.yml,用默认的 regular 档位,结果以 GitHub 注释的形式标在 PR 上,有发现就失败。github.token,开启 zizmor 的在线检查(核对钉住的 SHA 确实属于那个 action 仓库、有没有已知漏洞的 action 版本)。现有 workflow 没有扫出问题,不用改、也没有忽略项。
3. Dependabot
新加
.github/dependabot.yml:github-actions,每月检查一次,每个生态合成一个 PR;新版本发布满 7 天才提(cooldown,zizmor 也要求这一项)。scripts/repo_checks.py不用改:Dependabot 的提交作者是dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>,本来就符合 noreply 规则。test_repo_checks.py补了一条用这个真实身份的断言,防止以后改规则时把它挡掉。检查过的
python -B -I -X utf8 scripts/test_repo_checks.py通过。