Skip to main content
ドキュメントには頻繁に更新が加えられ、その都度公開されています。本ページの翻訳はまだ未完成な部分があることをご了承ください。最新の情報については、英語のドキュメンテーションをご参照ください。本ページの翻訳に問題がある場合はこちらまでご連絡ください。

Disabling or limiting GitHub Actions for your organization

Organization owners can disable, enable, and limit GitHub Actions for an organization.

About GitHub Actions permissions for your organization

By default, GitHub Actions is enabled on all repositories and organizations. You can choose to disable GitHub Actions or limit it to actions and reusable workflows in your organization. For more information about GitHub Actions, see "About GitHub Actions."

You can enable GitHub Actions for all repositories in your organization. When you enable GitHub Actions, workflows are able to run actions and reusable workflows located within your repository and any other public repository. You can disable GitHub Actions for all repositories in your organization. GitHub Actionsを無効化すると、リポジトリでワークフローが実行されなくなります。

Alternatively, you can enable GitHub Actions for all repositories in your organization but limit the actions and reusable workflows a workflow can run.

Managing GitHub Actions permissions for your organization

You can choose to disable GitHub Actions for all repositories in your organization, or only allow specific repositories. You can also limit the use of public actions and reusable workflows, so that people can only use local actions and reusable workflows that exist in your organization.

Note: You might not be able to manage these settings if your organization is managed by an enterprise that has overriding policy. For more information, see "Enforcing policies for GitHub Actions in your enterprise."

  1. In the top right corner of GitHub.com, click your profile photo, then click Your organizations. プロフィールメニューのあなたのOrganization

  2. Organizationの隣のSettings(設定)をクリックしてください。 設定ボタン

  3. In the left sidebar, click Actions, then click General.

  4. Under "Policies", select an option.

    If you choose Allow OWNER, and select non-OWNER, actions and reusable workflows, actions and reusable workflows within your organization are allowed, and there are additional options for allowing other specific actions and reusable workflows. For more information, see "Allowing select actions and reusable workflows to run."

    When you allow actions and reusable workflows from only in your organization, the policy blocks all access to actions authored by GitHub. For example, the actions/checkout action would not be accessible.

    Set actions policy for this organization

  5. Click Save.

Allowing select actions and reusable workflows to run

When you choose Allow OWNER, and select non-OWNER, actions and reusable workflows, local actions and reusable workflows are allowed, and there are additional options for allowing other specific actions and reusable workflows:

  • 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 and github organizations. For more information, see the actions and github 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 and reusable workflows: You can restrict workflows to use actions and reusable workflows in specific organizations and repositories.

    To restrict access to specific tags or commit SHAs of an action or reusable workflow, use the same syntax used in the workflow to select the action or reusable workflow.

    • For an action, the syntax is <OWNER>/<REPO>@<TAG OR SHA>. For example, use actions/javascript-action@v1.0.1 to select a tag or actions/javascript-action@172239021f7ba04fe7327647b213799853a9eb89 to select a SHA. For more information, see "Finding and customizing actions."
    • For a reusable workflow, the syntax is <OWNER>/<REPO>/<PATH>/<FILENAME>@<TAG OR SHA>. For example, octo-org/another-repo/.github/workflows/workflow.yml@v1. For more information, see "Reusing workflows."

    You can use the * wildcard character to match patterns. For example, to allow all actions and reusable workflows in organizations that start with space-org, you can specify space-org*/*. To allow all actions and reusable workflows 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 and reusable workflows 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 and reusable workflows to the allow list.

  1. In the top right corner of GitHub.com, click your profile photo, then click Your organizations. プロフィールメニューのあなたのOrganization

  2. Organizationの隣のSettings(設定)をクリックしてください。 設定ボタン

  3. In the left sidebar, click Actions, then click General.

  4. Under "Policies", select Allow OWNER, and select non-OWNER, actions and reusable workflows and add your required actions and reusable workflows to the list.

    Add actions and reusable workflows to the allow list

  5. Click Save.

Configuring required approval for workflows from public forks

パブリックリポジトリをフォークし、リポジトリのGitHub Actionsワークフローへの変更を提案するPull Requestをサブミットすることは誰でもできます。 フォークからのワークフローはシークレットなどの機密データにアクセスできませんが、悪用目的で変更された場合、メンテナが迷惑を被る可能性があります。

これを防ぐために、外部コラボレータのパブリックリポジトリへのPull Requestではワークフローは自動的には動作せず、まず承認が必要になることがあります。 デフォルトでは、すべての初めてのコントリビューターは、ワークフローを実行するのに承認を必要とします。

Note: Workflows triggered by pull_request_target events are run in the context of the base branch. Since the base branch is considered trusted, workflows triggered by these events will always run, regardless of approval settings.

You can configure this behavior for an organization using the procedure below. Modifying this setting overrides the configuration set at the enterprise level.

  1. In the top right corner of GitHub.com, click your profile photo, then click Your organizations. プロフィールメニューのあなたのOrganization

  2. Organizationの隣のSettings(設定)をクリックしてください。 設定ボタン

  3. In the left sidebar, click Actions, then click General.

  4. Fork pull request workflows from outside collaborators(外部コラボレーターからのPull Requestワークフローのフォーク)の下で、オプションを選択してください。 このオプションは、制限が緩いものから厳しいものへとリストされています。

    パブリックフォークからのワークフローの認証の設定

  5. Save(保存)をクリックして、設定を適用してください。

このポリシーが適用されるワークフローの実行の承認に関する詳しい情報については「パブリックフォークからのワークフローの実行の承認」を参照してください

Enabling workflows for private repository forks

プライベートリポジトリのフォークの利用に依存しているなら、ユーザがどのようにpull_requestイベントの際にワークフローを実行できるかを制御するポリシーを設定できます。 Available to private repositories only, you can configure these policy settings for organizations, or repositories.

If a policy is disabled for an organization, it cannot be enabled for repositories. If an organization enables a policy, the policy can be disabled for individual repositories.

  • Run workflows from fork pull requests(フォークのPull Requestからワークフローを実行) - 読み取りのみの権限を持ち、シークレットにはアクセスできないGITHUB_TOKENを使って、フォークのPull Requestからワークフローを実行することをユーザに許可します。
  • Send write tokens to workflows from pull requests(Pull Requestから書き込みトークンをワークフローに送信) - 書き込み権限を持つGITHUB_TOKENの利用をフォークからのPull Requestに許可します。
  • Send secrets to workflows from pull requests(Pull Requestからワークフローにシークレットを送信) - すべてのシークレットをPull Requestから利用可能にします。

Configuring the private fork policy for an organization

  1. In the top right corner of GitHub.com, click your profile photo, then click Your organizations. プロフィールメニューのあなたのOrganization
  2. Organizationの隣のSettings(設定)をクリックしてください。 設定ボタン
  3. In the left sidebar, click Actions, then click General.
  4. Fork pull request workflows(Pull Requestワークフローのフォーク)の下で、オプションを選択してください。 例: このリポジトリのアクションを有効化、無効化、または制限する
  5. Save(保存)をクリックして、設定を適用してください。

Setting the permissions of the GITHUB_TOKEN for your organization

GITHUB_TOKENに付与されるデフォルトの権限を設定できます。 For more information about the GITHUB_TOKEN, see "Automatic token authentication." You can choose a restricted set of permissions as the default, or apply permissive settings.

You can set the default permissions for the GITHUB_TOKEN in the settings for your organization or your repositories. If you select a restrictive option as the default in your organization settings, the same option is selected in the settings for repositories within your organization, and the permissive option is disabled. If your organization belongs to a GitHub Enterprise account and a more restrictive default has been selected in the enterprise settings, you won't be able to select the more permissive default in your organization settings.

リポジトリに対して書き込みアクセス権を持つ人は、ワークフローファイル中のpermissionsキーを編集することによって、GITHUB_TOKENに付与される権限を変更したり、必要に応じてアクセス権を追加したり削除したりできます。 詳しい情報については権限を参照してください。

Configuring the default GITHUB_TOKEN permissions

By default, when you create a new organization, GITHUB_TOKEN only has read access for the contents scope.

  1. In the top right corner of GitHub.com, click your profile photo, then click Your profile. プロフィール画像

  2. In the top right corner of GitHub.com, click your profile photo, then click Your organizations. プロフィールメニューのあなたのOrganization

  3. Organizationの隣のSettings(設定)をクリックしてください。 設定ボタン

  4. In the left sidebar, click Actions, then click General.

  5. Under "Workflow permissions", choose whether you want the GITHUB_TOKEN to have read and write access for all scopes, or just read access for the contents scope.

    Set GITHUB_TOKEN permissions for this organization

  6. Click Save to apply the settings.

Preventing GitHub Actions from creating or approving pull requests

You can choose to allow or prevent GitHub Actions workflows from creating or approving pull requests.

By default, when you create a new organization, workflows are not allowed to create or approve pull requests.

  1. In the top right corner of GitHub.com, click your profile photo, then click Your profile. プロフィール画像

  2. In the top right corner of GitHub.com, click your profile photo, then click Your organizations. プロフィールメニューのあなたのOrganization

  3. Organizationの隣のSettings(設定)をクリックしてください。 設定ボタン

  4. In the left sidebar, click Actions, then click General.

  5. Under "Workflow permissions", use the Allow GitHub Actions to create and approve pull requests setting to configure whether GITHUB_TOKEN can create and approve pull requests.

    Set GITHUB_TOKEN pull request approval permission for this organization

  6. Click Save to apply the settings.