generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0423864
commit 9ab30dd
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Setup helm-docs | ||
description: Setup helm-docs | ||
inputs: | ||
version: | ||
description: Version | ||
required: true | ||
default: latest | ||
install-directory: | ||
description: Target installation directory | ||
required: false | ||
default: '$HOME/.helm-docs/bin' | ||
outputs: | ||
path: | ||
description: Path to the installed helm-docs executable | ||
value: ${{ steps.install.outputs.path }} | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install helm-docs | ||
id: install | ||
shell: bash | ||
run: | | ||
version=${{ inputs.version}} | ||
install_directory=${{ inputs.install-directory }} | ||
if [ "$version" == latest ]; then | ||
version=$(curl -sSf https://api.github.com/repos/norwoodj/helm-docs/releases/latest | jq -r .tag_name) | ||
fi | ||
version=${version/#v/} | ||
case $(uname -s) in | ||
Linux) | ||
os=Linux | ||
;; | ||
*) | ||
>&1 echo "Unsupported OS: $(uname -s)" | ||
exit 1 | ||
;; | ||
esac | ||
case $(uname -m) in | ||
arm64|aarch64) | ||
arch=arm64 | ||
;; | ||
x86_64|amd64) | ||
arch=x86_64 | ||
;; | ||
*) | ||
>&1 echo "§Unsupported architecture: $(uname -m)" | ||
exit 1 | ||
;; | ||
esac | ||
mkdir -p "$install_directory" | ||
temp_directory=$(mktemp -d) | ||
trap 'rm -rf $temp_directory' EXIT | ||
curl -sSfL https://github.com/norwoodj/helm-docs/releases/download/v${version}/helm-docs_${version}_${os}_${arch}.tar.gz | tar xz -C $temp_directory | ||
cp -f $temp_directory/helm-docs $install_directory | ||
chmod a+x "$install_directory/helm-docs" | ||
echo "$install_directory" >> $GITHUB_PATH | ||
echo "path=$install_directory/helm-docs" >> $GITHUB_OUTPUT |