diff --git a/content/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets.md b/content/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets.md index 3ef2805ac7..8e75987c34 100644 --- a/content/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets.md +++ b/content/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets.md @@ -130,6 +130,31 @@ Enabling force pushes will not override any other rules. For example, if a branc If a site administrator has blocked force pushes to the default branch only, you can still enable force pushes for any other branch or tag.{% endif %} +{% ifversion repo-rules-required-workflows %} + +## Require workflows to pass before merging + +{% note %} + +**Notes:** + +- This rule is in public beta and subject to change. +- This rule is replacing required workflows for {% data variables.product.prodname_actions %}. You can read more about this change on the [{% data variables.product.company_short %} blog](https://github.blog/changelog/2023-08-02-github-actions-required-workflows-will-move-to-repository-rules/). + +{% endnote %} + +You can require all changes made to a targeted branch to pass specified workflows before they can be merged. This rule can only be configured at the organization level. + +To use this rule, you must first create a workflow file. The workflow file needs to be in a repository that matches the visibility of the repositories you want to run it in. Specifically, a public workflow can run on any repository in your organization, an internal workflow can only run on internal and private repositories, and a private workflow can only run on private repositories. For more information, see "[AUTOTITLE](/actions/using-workflows/about-workflows)." + +If the workflow file is in an internal or private repository and you want to use the workflow in other repositories in the organization, you will need to allow access to the workflow from outside the repository. For more information, see "[Allowing access to components in an internal repository](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-an-internal-repository)" or "[Allowing access to components in a private repository](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-an-internal-repository)." + +When you add this rule to a ruleset, you will select the source repository and the workflow you want to enforce. The workflow triggers on the `pull_request` or `merge_group` events. + +A workflow can also block someone from creating a repository, since a workflow can't run against a repository that's being initialized. To get around this, the ruleset either needs to have "Evaluate" as the enforcement status, or someone with bypass permissions needs to create the repository and bypass the branch protection. + +{% endif %} + {% ifversion repo-rules-enterprise %} ## Metadata restrictions diff --git a/data/features/repo-rules-required-workflows.yml b/data/features/repo-rules-required-workflows.yml new file mode 100644 index 0000000000..6ec953c3f6 --- /dev/null +++ b/data/features/repo-rules-required-workflows.yml @@ -0,0 +1,5 @@ +# Reference: #11605 +# Required workflows on GitHub Actions are moving to Repository Rules +versions: + ghec: '*' + ghes: '>=3.12' diff --git a/data/reusables/actions/workflows/required-workflow-beta.md b/data/reusables/actions/workflows/required-workflow-beta.md index b0d3ce9edd..2ca3683297 100644 --- a/data/reusables/actions/workflows/required-workflow-beta.md +++ b/data/reusables/actions/workflows/required-workflow-beta.md @@ -1,5 +1,5 @@ {% note %} -**Note:** Required workflows for {% data variables.product.prodname_actions %} are in private beta and are not available for new signups.{% ifversion fpt or ghec %} On October 18th, 2023, you will no longer be able to access required workflows for {% data variables.product.prodname_actions %} and must use repository rulesets instead. You can read more about this change on the [{% data variables.product.company_short %} blog](https://github.blog/changelog/2023-08-02-github-actions-required-workflows-will-move-to-repository-rules/). For more information about repository rulesets, see "[AUTOTITLE](/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets)."{% endif %} +**Note:** Required workflows for {% data variables.product.prodname_actions %} are in private beta and are not available for new sign ups.{% ifversion repo-rules-required-workflows %} On October 18th, 2023, you will no longer be able to access required workflows for {% data variables.product.prodname_actions %} and must use repository rulesets instead. You can read more about this change on the [{% data variables.product.company_short %} blog](https://github.blog/changelog/2023-08-02-github-actions-required-workflows-will-move-to-repository-rules/). For more information about repository rulesets, see "[AUTOTITLE](/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets#require-workflows-to-pass-before-merging)."{% endif %} {% endnote %}