Skip to content

Commit 80c816f

Browse files
authored
feature: Use static binary instead of docker image (#75)
* feature: Use static binary instead of docker image * Install in /usr/local/bin * Remove --folder /repo * Use tool-version when provided * Quote strings in bash
1 parent f68a42d commit 80c816f

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

action.yml

+12-6
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,23 @@ outputs:
4242
runs:
4343
using: "composite"
4444
steps:
45+
- shell: bash
46+
run: |
47+
set -eo pipefail
48+
if [ "${{ inputs.tool-version }}" = "latest" ]; then
49+
download_url="$(curl -Ls https://api.github.com/repos/codacy/git-version/releases/latest | jq -r .assets[0].browser_download_url)"
50+
else
51+
download_url="https://github.com/codacy/git-version/releases/download/${{ inputs.tool-version }}/git-version"
52+
fi
53+
curl -Ls "$download_url" > /usr/local/bin/git-version
54+
chmod +x /usr/local/bin/git-version
4555
- id: previous-version
4656
shell: bash
4757
run: |
4858
set -eo pipefail
4959
50-
export PREVIOUS_VERSION=$(docker run -v $(pwd):/repo codacy/git-version:${{ inputs.tool-version }} \
51-
/bin/git-version \
60+
export PREVIOUS_VERSION=$(git-version \
5261
--previous-version \
53-
--folder /repo \
5462
--release-branch "${{ inputs.release-branch }}" \
5563
--dev-branch "${{ inputs.dev-branch }}" \
5664
--minor-identifier="${{ inputs.minor-identifier }}" \
@@ -64,9 +72,7 @@ runs:
6472
run: |
6573
set -eo pipefail
6674
67-
export VERSION=$(docker run -v $(pwd):/repo codacy/git-version:${{ inputs.tool-version }} \
68-
/bin/git-version \
69-
--folder /repo \
75+
export VERSION=$(git-version \
7076
--release-branch "${{ inputs.release-branch }}" \
7177
--dev-branch "${{ inputs.dev-branch }}" \
7278
--minor-identifier="${{ inputs.minor-identifier }}" \

0 commit comments

Comments
 (0)