Skip to main content

Sharing workflows, secrets, and runners with your organization

Learn how you can use organization features to collaborate with your team, by sharing starter workflows, secrets, and self-hosted runners.

注意:GitHub Enterprise Server 目前不支持 GitHub 托管的运行器。 可以在 GitHub public roadmap 上查看有关未来支持计划的更多信息。


If you need to share workflows and other GitHub Actions features with your team, then consider collaborating within a GitHub organization. An organization allows you to centrally store and manage secrets, artifacts, and self-hosted runners. You can also create starter workflows in the .github repository and share them with other users in your organization.

Sharing workflows

Your organization can share workflows by reusing the workflows exactly or by creating starter workflows that provide templates for new workflows.

Reusing workflows

You can share workflows with your organization, publicly or privately, by calling one workflow from within another workflow. This allows you to reuse workflows, avoiding duplication and making your workflows easier to maintain. For more information, see "Reusing workflows."

Using starter workflows

组织中所有有权创建工作流的人员可利用入门工作流,更快、更轻松地创建工作流。 创建新工作流时,你可以选择入门工作流,系统将为你完成编写工作流的部分或全部工作。 你可以使用入门工作流作为基础来构建自定义工作流,或按原样使用。 这不仅可以节省时间,而且促进了整个组织的一致性和最佳做法。 For more information, see "Creating starter workflows for your organization."

Sharing secrets within an organization

You can centrally manage your secrets within an organization, and then make them available to selected repositories. This also means that you can update a secret in one location, and have the change apply to all repository workflows that use the secret.

When creating a secret in an organization, you can use a policy to limit which repositories can access that secret. For example, you can grant access to all repositories, or limit access to only private repositories or a specified list of repositories.

要在组织级别创建机密,必须具有 admin 访问权限。

  1. On your GitHub Enterprise Server instance, navigate to the main page of the organization.

  2. 在组织名称下,单击“设置”。 组织设置按钮

  3. In the left sidebar, click Secrets.

  4. Click New secret.

  5. Type a name for your secret in the Name input box.

  6. Enter the Value for your secret.

  7. From the Repository access dropdown list, choose an access policy.

  8. Click Add secret.

Share self-hosted runners within an organization

Organization admins can add their self-hosted runners to groups, and then create policies that control which repositories can access the group.

For more information, see "Managing access to self-hosted runners using groups."

Next steps

To continue learning about GitHub Actions, see "Creating starter workflows for your organization."