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

janhoy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new 33b74e65caf SOLR-17249 Edit .asf.yaml on main branch (#2624)
33b74e65caf is described below

commit 33b74e65caf46062737bbc6bc3507a39b1049f67
Author: Jan Høydahl <[email protected]>
AuthorDate: Mon Oct 7 23:32:42 2024 +0200

    SOLR-17249 Edit .asf.yaml on main branch (#2624)
---
 dev-tools/scripts/releaseWizard.yaml | 41 +++++++++++++++++++++++++++---------
 1 file changed, 31 insertions(+), 10 deletions(-)

diff --git a/dev-tools/scripts/releaseWizard.yaml 
b/dev-tools/scripts/releaseWizard.yaml
index 5de7067d331..6b1a84041de 100644
--- a/dev-tools/scripts/releaseWizard.yaml
+++ b/dev-tools/scripts/releaseWizard.yaml
@@ -391,7 +391,6 @@ groups:
     title: Create a new minor branch off the stable branch
     description: |
       In our case we'll create {{ release_branch }}.
-      Also edit `.asf.yaml` to add the new branch under `protected_branches`.
     types:
     - major
     - minor
@@ -417,15 +416,37 @@ groups:
       - !Command
         cmd: git push --set-upstream origin {{ release_branch }}
         tee: true
-      - !Command
-        cmd: "{{ editor }} .asf.yaml"
-        comment: |
-          Add the new branch {{ release_branch }} under `protected_branches` 
in `.asf.yaml`. An editor will open.
-        stdout: true
-      - !Command
-        cmd: git add .asf.yaml && git commit -m "Add branch protection for {{ 
release_branch }}" && git push
-        logfile: commit-branch-protection.log
-        tee: true
+  - !Todo
+    id: protect_branches
+    title: Protect the new git branch(es)
+    vars:
+      branch_names: "{{ release_branch }}{% if release_type == 'major' %} and 
{{ stable_branch }}{% endif %}"
+    description: >
+      Edit `.asf.yaml` to protect new git branch(es) {{ branch_names }}.
+    types:
+      - major
+      - minor
+    depends: create_minor_branch
+    commands: !Commands
+      root_folder: '{{ git_checkout_folder }}'
+      commands_text: Run these commands to edit `.asf.yaml` and protect the 
new branch(es)
+      commands:
+        - !Command
+          cmd: git checkout main
+          tee: true
+        - !Command
+          cmd: git pull --ff-only
+          tee: true
+        - !Command
+          cmd: "{{ editor }} .asf.yaml"
+          comment: >
+            Add the newly created branch(es) {{ branch_names }}
+            under `protected_branches` in `.asf.yaml`. An editor will open.
+          stdout: true
+        - !Command
+          cmd: git add .asf.yaml && git commit -m "Add branch protection for 
{{ branch_names }}" && git push
+          logfile: commit-branch-protection.log
+          tee: true
   - !Todo
     id: update_minor_branch_prerelease_antora
     title: Update Ref Guide Metadata for new Minor Branch

Reply via email to