mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-08-10 08:27:25 +00:00
fix(content): harden Docker examples
This commit is contained in:
@@ -82,7 +82,7 @@ jobs:
|
||||
|
||||
### 21.2.3 最佳实践
|
||||
|
||||
* 固定 action 的主版本(例如 `@v4` / `@v6`),避免使用 `@master` 这类浮动引用。
|
||||
* 生产流水线要按完整 commit SHA 固定第三方 action;示例中使用 `@v4` / `@v6` 只是为了可读性,仍属于信任 tag 维护者的取舍,不能等同于不可变引用。
|
||||
* 设置最小权限(例如 `contents: read`),需要写入权限时再打开。
|
||||
* 需要依赖缓存时,优先使用官方支持的缓存方案(例如针对语言包管理器的 cache 或 BuildKit cache)。
|
||||
* 敏感凭据(Registry 密码、Deploy Key 等)一律通过 `secrets` 注入,禁止硬编码。
|
||||
|
||||
Reference in New Issue
Block a user