File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
.github/actions/ensure-release-branch Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 22 release_tag :
33 description : ' Release tag to build'
44 required : true
5+ release_branch :
6+ description : ' Existing release branch'
7+ required : false
58 allow_modify :
69 description : ' Allow modifying the repository'
710 default : false
2629 GITHUB_TOKEN : ${{ inputs.gh_token }}
2730 shell : bash
2831 run : |
29- ${{ github.action_path }}/ensure-release-branch.sh ${{ inputs.allow_modify == 'true' && '--allow-modify' || '' }} ${{ inputs.release_tag }}
32+ ${{ github.action_path }}/ensure-release-branch.sh ${{ inputs.allow_modify == 'true' && '--allow-modify' || '' }} ${{ inputs.release_branch != "" && format('--release-branch {0}', inputs.release_branch) || '' }} ${{ inputs. release_tag }}
Original file line number Diff line number Diff line change @@ -22,13 +22,19 @@ SCRIPT_DIR="$(dirname -- "$( readlink -f -- "$0"; )")"
2222# Parse arguments
2323ALLOW_MODIFY=" "
2424TAG=" "
25+ RELEASE_BRANCH=" "
2526
2627while [[ $# -gt 0 ]]; do
2728 case $1 in
2829 --allow-modify)
2930 ALLOW_MODIFY=1
3031 shift
3132 ;;
33+ --release-branch)
34+ RELEASE_BRANCH=" $2 "
35+ shift
36+ shift
37+ ;;
3238 -* )
3339 echo " Error: Unknown option $1 "
3440 exit 1
4753
4854if [ -z " $TAG " ]; then
4955 echo " Error: TAG is required as argument"
50- echo " Usage: $0 [--allow-modify] <TAG>"
56+ echo " Usage: $0 [--allow-modify] [--release-branch BRANCH] <TAG>"
5157 exit 1
5258fi
5359
@@ -59,8 +65,11 @@ echo "release_version_branch=$RELEASE_VERSION_BRANCH" >> "$GITHUB_OUTPUT"
5965echo " TAG: $TAG "
6066echo " RELEASE_VERSION_BRANCH: $RELEASE_VERSION_BRANCH "
6167
62- # Detect RELEASE_BRANCH name (release/X.Y format)
63- RELEASE_BRANCH=" release/$( echo " $TAG " | grep -Po ' ^\d+\.\d+' ) "
68+ if [ -z " $RELEASE_BRANCH " ]; then
69+ # Detect RELEASE_BRANCH name (release/X.Y format)
70+ RELEASE_BRANCH=" release/$( echo " $TAG " | grep -Po ' ^\d+\.\d+' ) "
71+ fi
72+
6473echo " RELEASE_BRANCH: $RELEASE_BRANCH "
6574echo " release_branch=$RELEASE_BRANCH " >> " $GITHUB_OUTPUT "
6675
You can’t perform that action at this time.
0 commit comments