10
10
env :
11
11
BRANCH_MAIN : main
12
12
BRANCH_DEVELOP : develop
13
- BRANCH_RELEASE_PREFIX : release
14
- BRANCH_HOTFIX_PREFIX : hotfix
15
13
TAG_PREFIX : v
16
14
17
15
jobs :
22
20
contents : write
23
21
# only merge pull requests that begin with 'release/' or 'hotfix/'
24
22
if : github.event.pull_request.merged == true &&
25
- (startsWith(github.head_ref, '${{ env.BRANCH_RELEASE_PREFIX }} /') || startsWith(github.head_ref, '${{ env.BRANCH_HOTFIX_PREFIX }} /'))
23
+ (startsWith(github.head_ref, 'release /') || startsWith(github.head_ref, 'hotfix /'))
26
24
27
25
steps :
28
26
- name : Set GitHub token
@@ -36,17 +34,17 @@ jobs:
36
34
token : ${{ env.GH_TOKEN }}
37
35
38
36
- name : Extract version from release branch
39
- if : startsWith(github.head_ref, '${{ env.BRANCH_RELEASE_PREFIX }} /')
37
+ if : startsWith(github.head_ref, 'release /')
40
38
run : |
41
39
BRANCH_NAME="${{ github.head_ref }}"
42
- VERSION=${BRANCH_NAME#${{ env.BRANCH_RELEASE_PREFIX }} /}
40
+ VERSION=${BRANCH_NAME#release /}
43
41
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
44
42
45
43
- name : Extract version from hotfix branch
46
- if : startsWith(github.head_ref, '${{ env.BRANCH_HOTFIX_PREFIX }} /')
44
+ if : startsWith(github.head_ref, 'hotfix /')
47
45
run : |
48
46
BRANCH_NAME="${{ github.head_ref }}"
49
- VERSION=${BRANCH_NAME#${{ env.BRANCH_HOTFIX_PREFIX }} /}
47
+ VERSION=${BRANCH_NAME#hotfix /}
50
48
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
51
49
52
50
- name : Create release
0 commit comments