Skip to content

Commit 479f833

Browse files
committed
fix: gh-86: allow flexible installation path for the git-version binary
Allow flexible installation path for the git-version binary in order to support self-hosted runners, where installation paths for tooling may vary Use elevated privileges to download + make tool executable
1 parent 995fc07 commit 479f833

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

action.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,21 @@ runs:
5454
else
5555
download_url="https://github.com/codacy/git-version/releases/download/${{ inputs.tool-version }}/git-version"
5656
fi
57-
curl -Ls "$download_url" > /usr/local/bin/git-version
58-
chmod +x /usr/local/bin/git-version
57+
sudo wget "$download_url" -O "${{ inputs.tool-installation-path }}/git-version"
58+
sudo chmod +x "${{ inputs.tool-installation-path }}/git-version"
5959
- id: previous-version
6060
shell: bash
6161
run: |
6262
set -eo pipefail
6363
64-
export PREVIOUS_VERSION=$(git-version \
64+
export PREVIOUS_VERSION=$(${{ inputs.tool-installation-path }}/git-version \
6565
--previous-version \
6666
--release-branch "${{ inputs.release-branch }}" \
6767
--dev-branch "${{ inputs.dev-branch }}" \
6868
--minor-identifier="${{ inputs.minor-identifier }}" \
6969
--major-identifier="${{ inputs.major-identifier }}" \
70-
${{ inputs.skip-prerelease == 'true' && '--skip-prerelease' || '' }} \
71-
--version-prefix "${{ inputs.prefix }}")
70+
--version-prefix "${{ inputs.prefix }}" \
71+
${{ inputs.skip-prerelease == 'true' && '--skip-prerelease' || '' }})
7272
7373
echo "previous-version=$PREVIOUS_VERSION" >> $GITHUB_OUTPUT
7474
echo "Previous Version: $PREVIOUS_VERSION"
@@ -77,14 +77,14 @@ runs:
7777
run: |
7878
set -eo pipefail
7979
80-
export VERSION=$(git-version \
80+
export VERSION=$(${{ inputs.tool-installation-path }}/git-version \
8181
--release-branch "${{ inputs.release-branch }}" \
8282
--dev-branch "${{ inputs.dev-branch }}" \
8383
--minor-identifier="${{ inputs.minor-identifier }}" \
8484
--major-identifier="${{ inputs.major-identifier }}" \
85-
--log-paths="${{ inputs.log-paths }}" \
86-
${{ inputs.skip-prerelease == 'true' && '--skip-prerelease' || '' }} \
87-
--version-prefix "${{ inputs.prefix }}")
85+
--log-paths="${{ inputs.log-paths }}" \
86+
--version-prefix "${{ inputs.prefix }}" \
87+
${{ inputs.skip-prerelease == 'true' && '--skip-prerelease' || '' }})
8888
8989
echo "version=$VERSION" >> $GITHUB_OUTPUT
9090
echo "New Version: $VERSION"

0 commit comments

Comments
 (0)