python / python/python-docs-es

Avoiding `pull_request_target` usage in workflows

未关闭
#3,864 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug github_actions
主要语言
Python
星标
371
派生
413
PR 合并指标
30 天内没有已合并 PR

描述

One of this repositories workflow's uses pull_request_target:

https://github.com/python/python-docs-es/blob/9b99734eefaa1b21480066abc9a336dad45b95cd/.github/workflows/pr-comment.yml#L4

Please see the GitHub documentation for a list of risks associated with the target. I see the workflow is currently quite careful, but IMO it is still better to split it into two, one for building and one for posting.

It is now disallowed by actions/checkout (see blog post). We are also considering disabling it across the organisation (new feature), but it would break this workflow.

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从第 4 行的 .github/workflows/pr-comment.yml 开始,阅读 GitHub 关于安全使用 pull_request_target 的指南,以及链接的 checkout 更改。按提议分离构建和发布职责,然后确认没有 workflow 使用 pull_request_target,并确认两个必需的 action 仍能安全运行。

由索引模型根据 Issue 内容生成。

评估

技术栈
github-actions
领域
ci-cd, security
Issue 类型
重构
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
55/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。