From dce556c57fb5e7861aa4e2966a0891562cb61cff Mon Sep 17 00:00:00 2001 From: leonsteinhaeuser Date: Fri, 15 Apr 2022 18:15:40 +0200 Subject: [PATCH 1/2] feature: added a check if the gh cli binary needs to be installed --- deps.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 deps.sh diff --git a/deps.sh b/deps.sh new file mode 100755 index 0000000..b8e71f7 --- /dev/null +++ b/deps.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# check if gh binary is available +if [ -x "$(command -v gh)" ]; then + echo 'gh cli is installed.' + exit 0 +fi + +version=${GH_CLI_VERSION:-2.8.0} +echo "Installing gh cli in version: $version" + +wget https://github.com/cli/cli/releases/download/v${version}/gh_${version}_linux_amd64.tar.gz +tar -xvf gh_${version}_linux_amd64.tar.gz +sudo cp $(pwd)/gh_${version}_linux_amd64/bin/gh /usr/local/bin/ \ No newline at end of file From 55c5fc2f7b923be633116df51595d91a3a074c86 Mon Sep 17 00:00:00 2001 From: leonsteinhaeuser Date: Fri, 15 Apr 2022 18:17:14 +0200 Subject: [PATCH 2/2] enhancement: added the dependency check --- action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/action.yml b/action.yml index 70957f0..3c7a133 100644 --- a/action.yml +++ b/action.yml @@ -58,6 +58,10 @@ branding: runs: using: "composite" steps: + - name: "Install the gh cli tool if not installed" + shell: bash + run: ./deps.sh + - name: "Error missing auth conf" if: inputs.gh_app_secret_key == '' && inputs.gh_app_ID == '' && inputs.gh_token == '' shell: bash