About GitHub Actions access to internal and private repositories
If your organization is owned by an enterprise account, you can share actions and reusable workflows within your enterprise, without publishing them publicly, by allowing GitHub Actions workflows to access an internal or private repository that contains the action or reusable workflow.
Any actions or reusable workflows stored in the internal or private repository can be used in workflows defined in other internal or private repositories owned by the same organization, or by any organization owned by the enterprise. Actions and reusable workflows stored in internal repositories cannot be used in public repositories and actions and reusable workflows stored in private repositories cannot be used in public or internal repositories.
警告
- 如果使专用存储库可供其他存储库中的 GitHub Actions 工作流访问,则其他存储库中的外部协作者可以间接访问专用存储库,即使他们没有直接访问这些存储库的权限。 当使用来自专用存储库的操作或工作流时,外部协作者可以查看工作流运行的日志。
- 为了允许运行器下载这些操作,GitHub 向运行器传递一个作用域内的安装令牌。 此令牌具有对存储库的读取访问权限,会在一小时后自动过期。
Sharing actions and workflows with your enterprise
- Store the action or reusable workflow in an internal or private repository. For more information, see 关于仓库.
- Configure the repository to allow access to workflows in other internal or private repositories. For more information, see 管理存储库的 GitHub Actions 设置 and 管理存储库的 GitHub Actions 设置.