Skip to content

World's first open-source enterprise world model.

A workflow without a permissions block inherits more than it needs (#187)

WaylandYang401fcda0dce5
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c9f51061..425617c5 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -90,6 +90,8 @@ cargo test --workspace
**Commit messages: one English sentence, stating the motivation.** No long body. Skim `git log` for the register.
+**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.
+
## DCO: sign off every commit
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.
diff --git a/CONTRIBUTING.zh-CN.md b/CONTRIBUTING.zh-CN.md
index 1429527f..1d2258a2 100644
--- a/CONTRIBUTING.zh-CN.md
+++ b/CONTRIBUTING.zh-CN.md
@@ -90,6 +90,8 @@ cargo test --workspace
**提交信息一句英文,说清动机。** 不写长 body。看一眼 `git log` 就知道调子。
+**每个 workflow 自己声明 `permissions:`。** 仓库默认现在是读写——有一个 workflow 要把生成的图提交回来。不写 `permissions:` 块的 workflow 会继承那个默认,于是一个只需要读的任务悄悄拿到了写权限。按这个任务实际需要的最小集写:只做构建或测试的,写 `contents: read`。
+
## DCO:每个提交要签
我们用 [DCO](https://developercertificate.org/)(开发者原创声明),不用 CLA。你保留自己代码的著作权,只是声明你有权按 Apache-2.0 提交它。