From 76610c3bf6dbc9ee090e434f05c6c26075bf3619 Mon Sep 17 00:00:00 2001 From: Christoph Barbian Date: Fri, 7 Jul 2023 13:48:49 +0200 Subject: [PATCH] update .github/actions --- .github/actions/setup-helm-docs/action.yaml | 57 +++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/actions/setup-helm-docs/action.yaml diff --git a/.github/actions/setup-helm-docs/action.yaml b/.github/actions/setup-helm-docs/action.yaml new file mode 100644 index 0000000..86ae8fb --- /dev/null +++ b/.github/actions/setup-helm-docs/action.yaml @@ -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 \ No newline at end of file