Skip to main content

此版本的 GitHub Enterprise Server 已于以下日期停止服务 2026-03-17. 即使针对重大安全问题,也不会发布补丁。 为了获得更好的性能、更高的安全性和新功能,请升级到最新版本的 GitHub Enterprise。 如需升级帮助,请联系 GitHub Enterprise 支持

启用推送保护委派绕过

通过要求指定审阅者绕过审批,控制谁可以推送包含机密的代码。

谁可以使用此功能?

具有管理员角色的存储库所有者、组织所有者、安全管理员和用户

注意

Delegated bypass for push protection is currently in beta and subject to change.

Delegated bypass for push protection lets you define who can push commits containing secrets and adds an approval process for other contributors. See About delegated bypass for push protection.

To enable delegated bypass, create the teams or roles that will manage bypass requests.

Enabling delegated bypass for a repository

注意

If an organization owner configures delegated bypass at the organization-level, the repository-level settings are disabled.

  1. On GitHub, navigate to the main page of the repository.

  2. Under your repository name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.

    Screenshot of a repository header showing the tabs. The "Settings" tab is highlighted by a dark orange outline.

  3. In the "Security" section of the sidebar, click Code security and analysis.

  1. Under "Code security and analysis", find "GitHub Advanced Security."

  2. Under "Push protection," to the right of "Who can bypass push protection for secret scanning," select the dropdown menu, then click Specific roles or teams.

  3. Under "Bypass list," click Add role or team.

    注意

    When you add roles or teams to the "bypass list," these users will be granted the ability to bypass push protection, and they can also review and manage the requests from all other contributors to bypass push protection.

    You can't add secret teams to the bypass list.

  4. In the dialog box, select the roles and teams that you want to add to the bypass list, then click Add selected.

Enabling delegated bypass for an organization

  1. On GitHub, navigate to the main page of the organization.

  2. Under your organization name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.

    Screenshot of the tabs in an organization's profile. The "Settings" tab is outlined in dark orange.

  3. In the "Security" section of the sidebar, select the Code security and analysis dropdown menu, then click Global settings.

  4. Under "Push protection," to the right of "Who can bypass push protection for secret scanning," select the dropdown menu, then click Specific roles or teams.

  5. Under "Bypass list," click Add role or team.

  6. In the dialog box, select the roles and teams that you want to add to the bypass list, then click Add selected.