1
1
name : Git Version
2
2
author : " Codacy"
3
- description : ' Semver versioning based on the git history and commit messages of your repository.'
3
+ description : " Semver versioning based on the git history and commit messages of your repository."
4
4
branding :
5
- icon : ' git-branch'
6
- color : ' gray-dark'
5
+ icon : " git-branch"
6
+ color : " gray-dark"
7
7
inputs :
8
8
tool-version :
9
- description : ' The version of the tool to be ran'
9
+ description : " The version of the tool to be ran"
10
10
required : true
11
11
default : latest
12
+ tool-installation-path :
13
+ description : " The path where the tool will be installed"
14
+ required : false
15
+ default : /usr/local/bin
12
16
release-branch :
13
- description : ' The name of the release branch'
17
+ description : " The name of the release branch"
14
18
required : true
15
19
default : master
16
20
dev-branch :
17
- description : ' The name of the dev branch'
21
+ description : " The name of the dev branch"
18
22
required : true
19
23
default : dev
20
24
minor-identifier :
21
- description : ' The string or regex to identify a minor release commit'
25
+ description : " The string or regex to identify a minor release commit"
22
26
required : true
23
- default : ' feature:'
27
+ default : " feature:"
24
28
major-identifier :
25
- description : ' The string or regex to identify a major release commit'
29
+ description : " The string or regex to identify a major release commit"
26
30
required : true
27
- default : ' breaking:'
31
+ default : " breaking:"
28
32
skip-prerelease :
29
- description : ' Skip prerelease part of the version. When true, release-branch and dev-branch are effectively ignored'
33
+ description : " Skip prerelease part of the version. When true, release-branch and dev-branch are effectively ignored"
30
34
required : true
31
- default : ' false'
35
+ default : " false"
32
36
prefix :
33
- description : ' The prefix to use in the version'
37
+ description : " The prefix to use in the version"
34
38
required : false
35
39
log-paths :
36
- description : ' The paths to be used to calculate changes (comma-separated)'
40
+ description : " The paths to be used to calculate changes (comma-separated)"
37
41
required : false
38
42
default : ./
39
43
outputs :
40
44
version :
41
- description : ' The value of the new pre-calculated tag'
45
+ description : " The value of the new pre-calculated tag"
42
46
value : ${{ steps.version.outputs.version }}
43
47
previous-version :
44
- description : ' Contains the value of previous tag, before calculating a new one'
48
+ description : " Contains the value of previous tag, before calculating a new one"
45
49
value : ${{ steps.previous-version.outputs.previous-version }}
46
50
runs :
47
51
using : " composite"
@@ -54,21 +58,21 @@ runs:
54
58
else
55
59
download_url="https://github.com/codacy/git-version/releases/download/${{ inputs.tool-version }}/git-version"
56
60
fi
57
- curl -Ls "$download_url" > /usr/local/bin/ git-version
58
- chmod +x /usr/local/bin/ git-version
61
+ sudo wget "$download_url" -O "${{ inputs.tool-installation-path }}/ git-version"
62
+ sudo chmod +x "${{ inputs.tool-installation-path }}/ git-version"
59
63
- id : previous-version
60
64
shell : bash
61
65
run : |
62
66
set -eo pipefail
63
67
64
- export PREVIOUS_VERSION=$(git-version \
68
+ export PREVIOUS_VERSION=$(${{ inputs.tool-installation-path }}/ git-version \
65
69
--previous-version \
66
70
--release-branch "${{ inputs.release-branch }}" \
67
71
--dev-branch "${{ inputs.dev-branch }}" \
68
72
--minor-identifier="${{ inputs.minor-identifier }}" \
69
73
--major-identifier="${{ inputs.major-identifier }}" \
70
- ${{ inputs.skip-prerelease == 'true' && '--skip-prerelease' || '' }} \
71
- --version-prefix " ${{ inputs.prefix }}" )
74
+ --version-prefix " ${{ inputs.prefix }}" \
75
+ ${{ inputs.skip-prerelease == 'true' && '--skip-prerelease' || '' }} )
72
76
73
77
echo "previous-version=$PREVIOUS_VERSION" >> $GITHUB_OUTPUT
74
78
echo "Previous Version: $PREVIOUS_VERSION"
@@ -77,14 +81,14 @@ runs:
77
81
run : |
78
82
set -eo pipefail
79
83
80
- export VERSION=$(git-version \
84
+ export VERSION=$(${{ inputs.tool-installation-path }}/ git-version \
81
85
--release-branch "${{ inputs.release-branch }}" \
82
86
--dev-branch "${{ inputs.dev-branch }}" \
83
87
--minor-identifier="${{ inputs.minor-identifier }}" \
84
88
--major-identifier="${{ inputs.major-identifier }}" \
85
- --log-paths="${{ inputs.log-paths }}" \
86
- ${{ inputs.skip-prerelease == 'true' && '--skip-prerelease' || '' }} \
87
- --version-prefix " ${{ inputs.prefix }}" )
89
+ --log-paths="${{ inputs.log-paths }}" \
90
+ --version-prefix " ${{ inputs.prefix }}" \
91
+ ${{ inputs.skip-prerelease == 'true' && '--skip-prerelease' || '' }} )
88
92
89
93
echo "version=$VERSION" >> $GITHUB_OUTPUT
90
94
echo "New Version: $VERSION"
0 commit comments