pull_request_target 强制执行将于 12 月 2 日开始
pull_request_target enforcement begins December 2
导读
自 2026 年 12 月 2 日(周三)起,GitHub Actions 将在受影响的公共仓库中默认阻止 pull_request_target 工作流,除非适用的 GitHub Actions 事件策略明确允许。此日期未变,是 11 月 2 日公告的提醒。私有和内部仓库不受影响,已配置的适用事件策略仍然有效;该变更适用于 GitHub Free、GitHub Team 和 GitHub Enterprise Cloud 上受影响的公共仓库。
正在把原文翻译成中文,长文需要一两分钟;先显示原文。
Retired
December 2, 20261 minute read
Starting Wednesday, December 2, 2026, GitHub Actions will block pull_request_target workflows by default in affected public repositories unless an applicable GitHub Actions event policy explicitly allows them.
This is a reminder of the change we announced on November 2. The enforcement date hasn't changed.
Workflows triggered by pull_request_target run in the base repository's context and can access its secrets. Running untrusted code from a fork in that context can expose secrets or compromise your build pipeline.
Private and internal repositories aren't affected, and an applicable event policy you've already configured still applies.
If you maintain workflows that respond to pull requests from forks, check Policy insights for blocked workflow runs. Update affected workflows to use a safer event, such as pull_request, where appropriate. If a workflow requires pull_request_target, create or update an applicable GitHub Actions event policy to explicitly allow it. You can scope the policy to specific workflow files. Only allow the event after confirming your workflow won't execute untrusted pull request code with access to secrets or a privileged token.
This change will apply to affected public repositories on GitHub Free, GitHub Team, and GitHub Enterprise Cloud.
For details, see the default policy for pull_request_target and how to configure event policies and view policy insights.
出处
- S 官方GitHub Changelog · RSS阅读原文 ↗
pull_request_target enforcement begins December 2