Commit cd3e5f9 1 parent e82be5b commit cd3e5f9 Copy full SHA for cd3e5f9
File tree 2 files changed +11
-6
lines changed
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 10
10
runs-on : ubuntu-latest
11
11
12
12
steps :
13
+ - name : Checkout repository
14
+ uses : actions/checkout@v4
15
+
13
16
- name : Determine version update type
14
17
id : determine_version
15
18
run : |
Original file line number Diff line number Diff line change @@ -34,21 +34,23 @@ jobs:
34
34
- name : Extract version and previous tag
35
35
id : extract_info
36
36
run : |
37
- TAG_NAME=${GITHUB_REF#refs/tags/}
38
- VERSION=$TAG_NAME
39
- PREVIOUS_TAG=$(git describe --tags $(git rev-list --tags --skip=1 --max-count=1))
37
+ VERSION=${GITHUB_REF#refs/tags/v}
38
+ PREVIOUS_TAG=$(git describe --tags $(git rev-list --tags $GITHUB_SHA --skip=1 --max-count=1))
40
39
echo "VERSION=$VERSION" >> $GITHUB_ENV
41
40
echo "PREVIOUS_TAG=$PREVIOUS_TAG" >> $GITHUB_ENV
42
41
43
42
- name : Determine update type
44
43
id : determine_update_type
45
44
run : |
46
- IFS='.' read -r -a NEW_VERSION_PARTS <<< "${VERSION#v }"
45
+ IFS='.' read -r -a NEW_VERSION_PARTS <<< "${VERSION}"
47
46
IFS='.' read -r -a OLD_VERSION_PARTS <<< "${PREVIOUS_TAG#v}"
48
47
49
- if [ "${NEW_VERSION_PARTS[0]}" -ne "${OLD_VERSION_PARTS[0]}" ]; then
48
+ echo "New version parts: ${NEW_VERSION_PARTS[@]}"
49
+ echo "Old version parts: ${OLD_VERSION_PARTS[@]}"
50
+
51
+ if [ "${NEW_VERSION_PARTS[0]}" != "${OLD_VERSION_PARTS[0]}" ]; then
50
52
UPDATE_TYPE=major
51
- elif [ "${NEW_VERSION_PARTS[1]}" -ne "${OLD_VERSION_PARTS[1]}" ]; then
53
+ elif [ "${NEW_VERSION_PARTS[1]}" != "${OLD_VERSION_PARTS[1]}" ]; then
52
54
UPDATE_TYPE=minor
53
55
else
54
56
UPDATE_TYPE=patch
You can’t perform that action at this time.
0 commit comments