About GitHub Actions permissions for your enterprise account
By default, GitHub Actions is enabled in all organizations owned by an enterprise account. You can choose to disable GitHub Actions for all organizations owned by an enterprise account, or only allow specified organizations. You can also limit the use of public actions, so that people can only use local actions that exist in your organization.
For more information about GitHub Actions, see "About GitHub Actions."
Managing GitHub Actions permissions for your enterprise account
You can disable all workflows for an enterprise or set a policy that configures which actions can be used in an organization.
If you choose Allow select actions, local actions are allowed, and there are additional options for allowing other specific actions. For more information, see "Allowing specific actions to run."
When you allow local actions only, the policy blocks all access to actions authored by GitHub. For example, the actions/checkout
would not be accessible.
-
In the top-right corner of GitHub, click your profile photo, then click Your enterprises.
-
In the list of enterprises, click the enterprise you want to view.
-
In the enterprise sidebar, click Policies.
-
Under " Policies", click Actions.
-
Under "Policies", select your options.
You can choose which organizations in your enterprise can use GitHub Actions, and you can restrict access to public actions.
-
Click Save.
Allowing specific actions to run
When you choose Allow select actions, local actions are allowed, and there are additional options for allowing other specific actions:
-
Allow actions created by GitHub: You can allow all actions created by GitHub to be used by workflows. Actions created by GitHub are located in the
actions
andgithub
organization. For more information, see theactions
andgithub
organizations. -
Allow Marketplace actions by verified creators: You can allow all GitHub Marketplace actions created by verified creators to be used by workflows. When GitHub has verified the creator of the action as a partner organization, the badge is displayed next to the action in GitHub Marketplace.
-
Allow specified actions: You can restrict workflows to use actions in specific organizations and repositories.
To restrict access to specific tags or commit SHAs of an action, use the same
<OWNER>/<REPO>@<TAG OR SHA>
syntax used in the workflow to select the action. For example,actions/[email protected]
to select a tag oractions/javascript-action@172239021f7ba04fe7327647b213799853a9eb89
to select a SHA. For more information, see "Finding and customizing actions."You can use the
*
wildcard character to match patterns. For example, to allow all actions in organizations that start withspace-org
, you can specifyspace-org*/*
. To add all actions in repositories that start with octocat, you can use*/octocat*@*
. For more information about using the*
wildcard, see "Workflow syntax for GitHub Actions."Note: The Allow specified actions option is only available in public repositories with the GitHub Free, GitHub Pro, GitHub Free for organizations, or GitHub Team plan.
This procedure demonstrates how to add specific actions to the allow list.
-
In the top-right corner of GitHub, click your profile photo, then click Your enterprises.
-
In the list of enterprises, click the enterprise you want to view.
-
In the enterprise sidebar, click Policies.
-
Under " Policies", click Actions.
-
Under Policies, select Allow select actions and add your required actions to the list.
Configuring required approval for workflows from public forks
Anyone can fork a public repository, and then submit a pull request that proposes changes to the repository's GitHub Actions workflows. Although workflows from forks do not have access to sensitive data such as secrets, they can be an annoyance for maintainers if they are modified for abusive purposes.
To help prevent this, workflows on pull requests to public repositories from some outside contributors will not run automatically, and might need to be approved first. By default, all first-time contributors require approval to run workflows. You can configure this behavior for your enterprise using the procedure below.
-
In the top-right corner of GitHub, click your profile photo, then click Your enterprises.
-
In the list of enterprises, click the enterprise you want to view.
-
In the enterprise sidebar, click Policies.
-
Under " Policies", click Actions.
-
Under Fork pull request workflows from outside collaborators, select your option. The options are listed from least restrictive to most restrictive.
-
Click Save to apply the settings.
For more information about approving workflow runs that this policy applies to, see "Approving workflow runs from public forks."
Enabling workflows for private repository forks
If you rely on using forks of your private repositories, you can configure policies that control how users can run workflows on pull_request
events. Available to private repositories only, you can configure these policy settings for enterprises, organizations, or repositories. For enterprises, the policies are applied to all repositories in all organizations.
- Run workflows from fork pull requests - Allows users to run workflows from fork pull requests, using a
GITHUB_TOKEN
with read-only permission, and with no access to secrets. - Send write tokens to workflows from pull requests - Allows pull requests from forks to use a
GITHUB_TOKEN
with write permission. - Send secrets to workflows from pull requests - Makes all secrets available to the pull request.
Configuring the private fork policy for your enterprise account
-
In the top-right corner of GitHub, click your profile photo, then click Your enterprises.
-
In the list of enterprises, click the enterprise you want to view.
-
In the enterprise sidebar, click Policies.
-
Under " Policies", click Actions.
-
Under Fork pull request workflows, select your options. For example:
-
Click Save to apply the settings.
Setting the permissions of the GITHUB_TOKEN
for your enterprise
You can set the default permissions granted to the GITHUB_TOKEN
. For more information about the GITHUB_TOKEN
, see "Authentication in a workflow." You can choose between a restricted set of permissions as the default or a permissive setting.
You can set the default permissions for the GITHUB_TOKEN
in the settings for your enterprise, organizations, or repositories. If you choose the restricted option as the default in your enterprise settings, this prevents the more permissive setting being chosen in the organization or repository settings.
Anyone with write access to a repository can modify the permissions granted to the GITHUB_TOKEN
, adding or removing access as required, by editing the permissions
key in the workflow file. For more information, see permissions
.
Configuring the default GITHUB_TOKEN
permissions
-
In the top-right corner of GitHub, click your profile photo, then click Your enterprises.
-
In the list of enterprises, click the enterprise you want to view.
-
In the enterprise sidebar, click Policies.
-
Under " Policies", click Actions.
-
Under Workflow permissions, choose whether you want the
GITHUB_TOKEN
to have read and write access for all scopes, or just read access for thecontents
scope. -
Click Save to apply the settings.