Elffuss BraidHub

kikocis/utopia public

A workflow without a permissions block inherits more than it needs (#187)
Changesete8031b33dc5ad13f7b3bd87f71d995629203797748d7fe9d127eff351ca5305a
AuthorWaylandYang <145302500+WaylandYang@users.noreply.github.com> · 2026-09-02 20:18 +08:00
CommitterGitHub <noreply@github.com> · 2026-09-02 20:18 +08:00
Parentsfe16bbb4f71a

Browse the files at this changeset

2 files changed

modified CONTRIBUTING.md +2 −0
@@ -90,6 +90,8 @@
9090
9191 **Commit messages: one English sentence, stating the motivation.** No long body. Skim `git log` for the register.
9292
93+**Every workflow declares its own `permissions:`.** The repository default is now read-and-write, because one workflow commits a generated chart. A workflow without a `permissions:` block inherits that default, so leaving it out silently hands write access to something that only needed to read. Declare the minimum the job actually needs — `contents: read` for anything that just builds or tests.
94+
9395 ## DCO: sign off every commit
9496
9597 We use the [DCO](https://developercertificate.org/), not a CLA. You keep the copyright on your code; you are certifying that you have the right to submit it under Apache-2.0.
modified CONTRIBUTING.zh-CN.md +2 −0
@@ -90,6 +90,8 @@
9090
9191 **提交信息一句英文,说清动机。** 不写长 body。看一眼 `git log` 就知道调子。
9292
93+**每个 workflow 自己声明 `permissions:`。** 仓库默认现在是读写——有一个 workflow 要把生成的图提交回来。不写 `permissions:` 块的 workflow 会继承那个默认,于是一个只需要读的任务悄悄拿到了写权限。按这个任务实际需要的最小集写:只做构建或测试的,写 `contents: read`。
94+
9395 ## DCO:每个提交要签
9496
9597 我们用 [DCO](https://developercertificate.org/)(开发者原创声明),不用 CLA。你保留自己代码的著作权,只是声明你有权按 Apache-2.0 提交它。