File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 10
10
options :
11
11
- RC
12
12
- Hotfix
13
- rc_prefix_date :
14
- description : ' RC - Prefix with date. E.g. 2024.11-rc1'
15
- type : boolean
16
- default : true
17
13
18
14
jobs :
19
15
create-release-branch :
30
26
- name : Create RC Branch
31
27
if : inputs.release_type == 'RC'
32
28
env :
33
- RC_PREFIX_DATE : ${{ inputs.rc_prefix_date }}
29
+ RC_PREFIX_DATE : " true " # replace with input if needed
34
30
run : |
35
31
if [ "$RC_PREFIX_DATE" = "true" ]; then
36
32
current_date=$(date +'%Y.%m')
@@ -46,12 +42,17 @@ jobs:
46
42
- name : Create Hotfix Branch
47
43
if : inputs.release_type == 'Hotfix'
48
44
run : |
49
- latest_tag=$(git describe --tags --abbrev=0 )
45
+ latest_tag=$(git tag -l --sort=-creatordate | head -n 1 )
50
46
if [ -z "$latest_tag" ]; then
51
47
echo "::error::No tags found in the repository"
52
48
exit 1
53
49
fi
54
50
branch_name="release/hotfix-${latest_tag}"
51
+ echo "🌿 branch name: $branch_name"
52
+ if git show-ref --verify --quiet "refs/remotes/origin/$branch_name"; then
53
+ echo "# :fire: :warning: Hotfix branch already exists: ${branch_name}" >> $GITHUB_STEP_SUMMARY
54
+ exit 0
55
+ fi
55
56
git switch -c $branch_name $latest_tag
56
57
git push origin $branch_name
57
58
echo "# :fire: Hotfix branch: ${branch_name}" >> $GITHUB_STEP_SUMMARY
You can’t perform that action at this time.
0 commit comments