Skip to content

Commit

Permalink
update .github/actions
Browse files Browse the repository at this point in the history
  • Loading branch information
cbarbian-sap committed Jul 7, 2023
1 parent 49e4c77 commit 76610c3
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/actions/setup-helm-docs/action.yaml
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

0 comments on commit 76610c3

Please sign in to comment.