-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
When configuring exactly the same branch protection rules for multiple branches, it would be useful to use YAML anchor and references, for example:
# Enforce Review-then-Commit
protected_branches:
2.x: &default_protection
# All commits must be signed
required_signatures: true
# All reviews must be addressed before merging
required_conversation_resolution: true
# Require checks to pass before merging
required_status_checks:
checks:
# The GitHub Actions app: 15368
- app_id: 15368
context: "build"
- app_id: 15368
context: "codeql-analysis"
# At least one positive review must be present
required_pull_request_reviews:
required_approving_review_count: 1
main: *default_protectionAs far as I know strictyaml does not allow this feature for security reasons.
In this case an alternative might be allowing to specify the name of the branch that has an identical configuration:
# Enforce Review-then-Commit
protected_branches:
2.x:
# All commits must be signed
required_signatures: true
# All reviews must be addressed before merging
required_conversation_resolution: true
# Require checks to pass before merging
required_status_checks:
checks:
# The GitHub Actions app: 15368
- app_id: 15368
context: "build"
- app_id: 15368
context: "codeql-analysis"
# At least one positive review must be present
required_pull_request_reviews:
required_approving_review_count: 1
main: "2.x"Metadata
Metadata
Assignees
Labels
No labels