This is an automated email from the ASF dual-hosted git repository.
ppkarwasz pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/2.x by this push:
new 008f69bd29 Switches from `protected_branches` to `rulesets` (#4095)
008f69bd29 is described below
commit 008f69bd293397a52b592bfb7d466fdf19d2b133
Author: Piotr P. Karwasz <[email protected]>
AuthorDate: Wed Sep 2 23:48:57 2026 +0200
Switches from `protected_branches` to `rulesets` (#4095)
* Switches from `protected_branches` to `rulesets`
Similarly to apache/logging-parent#456 this PR switches from GitHub Branch
Protection to Rulesets and:
- Keeps the same rules for `main`, while protection `2.x` is
**temporarily** disabled in case we need to update the `.asf.yaml` file.
- Adds tag protection for the `rel/*` tags.
* Workaround `.asf.yaml` limitations
* fix: protect tags
* fix: special environment no longer needed
* fix: remove no longer needed workarounds
* fix: add `2.25.x` and `2.26.x` to the list
---
.asf.yaml | 59 ++++++++++++++++++++++++++++++++++-------------------------
1 file changed, 34 insertions(+), 25 deletions(-)
diff --git a/.asf.yaml b/.asf.yaml
index 1a37fb4923..805ab3bbcd 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -72,35 +72,44 @@ github:
merge: false
rebase: false
- # Enforce Review-then-Commit
- protected_branches:
- 2.x:
+ rulesets:
+ # Enforce Review-then-Commit
+ - name: "Branch protection"
+ type: branch
+ branches:
+ includes:
+ - "2.x"
+ - "2.25.x"
+ - "2.26.x"
+ - "main"
# 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 / build (ubuntu-latest)"
- # The GitHub Advanced Security app: 57789
- - app_id: 57789
- context: "CodeQL"
- # At least one positive review must be present
- required_pull_request_reviews:
- required_approving_review_count: 1
- main:
- # 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 / build (ubuntu-latest)"
- # The GitHub Advanced Security app: 57789
- - app_id: 57789
- context: "CodeQL"
+ # The GitHub Actions app
+ - app_slug: github-actions
+ name: "build / build (ubuntu-latest)"
+ # The GitHub Advanced Security
+ - app_slug: github-advanced-security
+ name: "CodeQL"
# At least one positive review must be present
required_pull_request_reviews:
required_approving_review_count: 1
+ # Use raw rules, until a convenience notation for `restrict_update` is
introduced.
+ # See: https://github.com/apache/infrastructure-asfyaml/issues/96
+ #
+ # The raw rules need to follow the syntax given in:
+ #
https://docs.github.com/en/rest/repos/rules?apiVersion=2026-03-10#update-a-repository-ruleset
+ - name: "Tag protection"
+ target: tag
+ enforcement: active
+ bypass_actors: []
+ conditions:
+ ref_name:
+ include:
+ - "refs/tags/rel/*"
+ exclude: []
+ rules:
+ - type: deletion
+ - type: non_fast_forward
+ - type: update