File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 29
29
fetch-depth : 0
30
30
token : ${{ steps.app-token.outputs.token }}
31
31
32
+ - name : Extract tag versions
33
+ run : |
34
+ regex="^v([0-9]+).([0-9]+)$"
35
+ if [[ ${{ github.event.inputs.releaseVersion }} =~ $regex ]]
36
+ then
37
+ echo Release version matches vX.X format
38
+ else
39
+ echo ERROR: release version should match the format vX.X
40
+ exit 1
41
+ fi
42
+
43
+ - name : Check if release already exists
44
+ run : |
45
+ if git ls-remote --quiet --exit-code origin refs/heads/release/${{ github.event.inputs.releaseVersion }} >/dev/null 2>&1
46
+ then
47
+ echo "Release ${{ github.event.inputs.releaseVersion }} already exists, patch will be perfomed"
48
+ else
49
+ echo "Release ${{ github.event.inputs.releaseVersion }} doesn't exist, patch cannot be performed"
50
+ exit 1
51
+ fi
52
+
32
53
- name : Checkout on existing release branch
33
54
run : |
34
55
git checkout release/${{ github.event.inputs.releaseVersion }}
Original file line number Diff line number Diff line change @@ -34,12 +34,25 @@ jobs:
34
34
35
35
- name : Extract tag versions
36
36
run : |
37
- regex="v([0-9]+).([0-9]+)"
37
+ regex="^ v([0-9]+).([0-9]+)$ "
38
38
if [[ ${{ github.event.inputs.releaseVersion }} =~ $regex ]]
39
39
then
40
40
echo "GITHUB_MAJOR_VERSION=${BASH_REMATCH[1]}" >> $GITHUB_ENV
41
41
echo "GITHUB_MINOR_VERSION=${BASH_REMATCH[2]}" >> $GITHUB_ENV
42
42
echo "GITHUB_SHORT_VERSION=${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.0" >> $GITHUB_ENV
43
+ else
44
+ echo ERROR: release version should match the format vX.X
45
+ exit 1
46
+ fi
47
+
48
+ - name : Check if release already exists
49
+ run : |
50
+ if git ls-remote --quiet --exit-code origin refs/heads/release/${{ github.event.inputs.releaseVersion }} >/dev/null 2>&1
51
+ then
52
+ echo "ERROR: Release ${{ github.event.inputs.releaseVersion }} already exists"
53
+ exit 1
54
+ else
55
+ echo "Release ${{ github.event.inputs.releaseVersion }} doesn't exist, it will be performed"
43
56
fi
44
57
45
58
- name : Checkout with new branch
You can’t perform that action at this time.
0 commit comments