Skip to content

Commit 4709783

Browse files
committed
Ability to set prefix for release version branches
In SNAP there is a conflicting namespaces for version tags and version branches
1 parent 6143d04 commit 4709783

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

.github/actions/ensure-release-branch/action.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ inputs:
55
release_branch:
66
description: 'Existing release branch'
77
required: false
8+
release_version_branch_prefix:
9+
description: 'Prefix for release version branch (e.g., "release/")'
10+
required: false
811
allow_modify:
912
description: 'Allow modifying the repository'
1013
default: false
@@ -28,5 +31,9 @@ runs:
2831
env:
2932
GITHUB_TOKEN: ${{ inputs.gh_token }}
3033
shell: bash
31-
run: |
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 }}
34+
run: >-
35+
${{ github.action_path }}/ensure-release-branch.sh
36+
${{ inputs.allow_modify == 'true' && '--allow-modify' || '' }}
37+
${{ inputs.release_branch != '' && format('--release-branch {0}', inputs.release_branch) || '' }}
38+
${{ inputs.release_version_branch_prefix != '' && format('--release-version-branch-prefix {0}', inputs.release_version_branch_prefix) || '' }}
39+
${{ inputs.release_tag }}

.github/actions/ensure-release-branch/ensure-release-branch.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ SCRIPT_DIR="$(dirname -- "$( readlink -f -- "$0"; )")"
2323
ALLOW_MODIFY=""
2424
TAG=""
2525
RELEASE_BRANCH=""
26+
RELEASE_VERSION_BRANCH_PREFIX=""
2627

2728
while [[ $# -gt 0 ]]; do
2829
case $1 in
@@ -35,6 +36,11 @@ while [[ $# -gt 0 ]]; do
3536
shift
3637
shift
3738
;;
39+
--release-version-branch-prefix)
40+
RELEASE_VERSION_BRANCH_PREFIX="$2"
41+
shift
42+
shift
43+
;;
3844
-*)
3945
echo "Error: Unknown option $1"
4046
exit 1
@@ -58,7 +64,7 @@ if [ -z "$TAG" ]; then
5864
fi
5965

6066
# Define RELEASE_VERSION_BRANCH which is the same as TAG
61-
RELEASE_VERSION_BRANCH="$TAG"
67+
RELEASE_VERSION_BRANCH="$RELEASE_VERSION_BRANCH_PREFIX$TAG"
6268

6369
echo "release_version_branch=$RELEASE_VERSION_BRANCH" >> "$GITHUB_OUTPUT"
6470

0 commit comments

Comments
 (0)