ppkarwasz commented on code in PR #2701:
URL: https://github.com/apache/shiro/pull/2701#discussion_r3296527188


##########
.asf.yaml:
##########
@@ -32,7 +32,29 @@ github:
     squash: true
     merge: true
     rebase: false
-
+  rulesets:
+    - name: "Branch Protection"
+      type: branch
+      branches:
+        includes:
+          - "main"

Review Comment:
   You should remove `main` from `protected_branches`, otherwise the branch 
will be protected both by the “Protected Branches” and “Rulesets” GitHub 
feature:
   
   ```yaml
   # Clear branch protection, since it is replaced by GitHub Rulesets
   protected_branches: { }
   ```



##########
.asf.yaml:
##########
@@ -32,7 +32,29 @@ github:
     squash: true
     merge: true
     rebase: false
-
+  rulesets:
+    - name: "Branch Protection"
+      type: branch
+      branches:
+        includes:
+          - "main"
+          - "release/*"
+        excludes: []
+      bypass_teams:
+        - "release-managers"
+      restrict_deletion: true
+      restrict_force_push: true
+      required_signatures: false
+      required_linear_history: true
+      required_conversation_resolution: false
+      required_pull_request_reviews:
+        dismiss_stale_reviews: true
+        require_last_push_approval: false
+        require_code_owner_reviews: false
+        required_approving_review_count: 0
+      required_status_checks:
+        - name: "build"
+          app_slug: -1

Review Comment:
   _Nit_: if you want to be more precise, workflows are started by an 
application with slug `github-actions`.
   
   ```suggestion
           - name: "build"
             app_slug: "github-actions"
   ```
   
   You might also consider adding CodeQL to the mix:
   
   ```yaml
   - name: "CodeQL (actions)"
     app_slug: "github-actions"
   - name: "CodeQL (java)"
     app_slug: "github-actions"
   - name: "CodeQL"
     app_slug: "github-advanced-security"
   ```
   
   > [!WARNING]
   > Before protecting `main`, consider testing on a non-default branch first. 
Otherwise, if the checks don't even start, you won't be able to modify the 
`.asf.yaml` file itself.
   >
   > Yes, I am talking from experience 🤣 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to