跳至主要内容

防止对发布进行更改

您可以对仓库或组织强制不可变发布,以防止潜在的漏洞。

对您的仓库强制不可变发布

  1. 在 GitHub 上,导航至仓库的主页面。

  2. 在您的仓库名称下,点击 设置。如果您看不到“设置”标签,请选择 下拉菜单,然后点击 设置

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

  3. 向下滚动到 “Releases”(发布) 部分,然后选择 启用发布不可变性。请注意,不可变性仅适用于未来的发布。

对您的组织强制不可变发布

  1. 在 GitHub 上,前往该组织的首页。

  2. 在您的组织名称下,点击 设置。如果您看不到“设置”标签,请选择 下拉菜单,然后点击 设置

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

  3. 在侧边栏的 “代码、规划和自动化” 部分,选择 仓库 下拉菜单,然后点击 常规

  4. 在页面的 “Releases”(发布) 部分,选择 无策略下拉菜单,然后点击 “所有仓库” 或 “已选仓库”。请注意,不可变性仅适用于未来的发布。

  5. 如果您选择了 “已选仓库”,在下拉菜单右侧,点击。选择您想要包含的仓库,然后点击 选择仓库

© . This site is unofficial and not affiliated with GitHub, Inc.