@@ -391,7 +391,6 @@ groups:
391391 title : Create a new minor branch off the stable branch
392392 description : |
393393 In our case we'll create {{ release_branch }}.
394- Also edit `.asf.yaml` to add the new branch under `protected_branches`.
395394 types :
396395 - major
397396 - minor
@@ -417,15 +416,37 @@ groups:
417416 - !Command
418417 cmd : git push --set-upstream origin {{ release_branch }}
419418 tee : true
420- - !Command
421- cmd : " {{ editor }} .asf.yaml"
422- comment : |
423- Add the new branch {{ release_branch }} under `protected_branches` in `.asf.yaml`. An editor will open.
424- stdout : true
425- - !Command
426- cmd : git add .asf.yaml && git commit -m "Add branch protection for {{ release_branch }}" && git push
427- logfile : commit-branch-protection.log
428- tee : true
419+ - !Todo
420+ id : protect_branches
421+ title : Protect the new git branch(es)
422+ vars :
423+ branch_names : " {{ release_branch }}{% if release_type == 'major' %} and {{ stable_branch }}{% endif %}"
424+ description : >
425+ Edit `.asf.yaml` to protect new git branch(es) {{ branch_names }}.
426+ types :
427+ - major
428+ - minor
429+ depends : create_minor_branch
430+ commands : !Commands
431+ root_folder : ' {{ git_checkout_folder }}'
432+ commands_text : Run these commands to edit `.asf.yaml` and protect the new branch(es)
433+ commands :
434+ - !Command
435+ cmd : git checkout main
436+ tee : true
437+ - !Command
438+ cmd : git pull --ff-only
439+ tee : true
440+ - !Command
441+ cmd : " {{ editor }} .asf.yaml"
442+ comment : >
443+ Add the newly created branch(es) {{ branch_names }}
444+ under `protected_branches` in `.asf.yaml`. An editor will open.
445+ stdout : true
446+ - !Command
447+ cmd : git add .asf.yaml && git commit -m "Add branch protection for {{ branch_names }}" && git push
448+ logfile : commit-branch-protection.log
449+ tee : true
429450 - !Todo
430451 id : update_minor_branch_prerelease_antora
431452 title : Update Ref Guide Metadata for new Minor Branch
0 commit comments