This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling.git


The following commit(s) were added to refs/heads/master by this push:
     new 89c0e3b  SLING-12866 - Restrict force pushes, auto-delete branches on 
merge (#14)
89c0e3b is described below

commit 89c0e3b6231ab6d0d93932bf2d0283ded75f5967
Author: Robert Munteanu <[email protected]>
AuthorDate: Thu Aug 7 11:58:09 2025 +0200

    SLING-12866 - Restrict force pushes, auto-delete branches on merge (#14)
    
    Change update-asf-yaml script to reflect new defaults.
---
 scripts/update-asf-yaml.groovy | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/scripts/update-asf-yaml.groovy b/scripts/update-asf-yaml.groovy
index 374ba0c..24fee46 100644
--- a/scripts/update-asf-yaml.groovy
+++ b/scripts/update-asf-yaml.groovy
@@ -50,6 +50,19 @@ options.arguments().forEach { arg ->
         asfYaml['github'] = [:]
     }
 
+    if  ( ! asfYaml['github']['pull_requests'] ) {
+        asfYaml['github']['pull_requests'] = [:]
+    }
+
+    // delete branches on merge
+    asfYaml['github']['pull_requests']['del_branch_on_merge'] = true
+
+    // prevent force pushes to default branch and don't allow it to be deleted
+    if ( ! asfYaml['github']['protected_branches'] ) {
+        asfYaml['github']['protected_branches'] = [:]
+    }
+    asfYaml['github']['protected_branches']['master'] = [:]
+
     // set up autolinks ; note: missing merge
     // 
https://cwiki.apache.org/confluence/display/INFRA/Git+-+.asf.yaml+features#Git.asf.yamlfeatures-AutolinksforJira
     def autolinks = asfYaml['github']['autolinks']

Reply via email to