Skip to content

Commit

Permalink
feature: install gh cli if not present (#39)
Browse files Browse the repository at this point in the history
* feature: added a check if the gh cli binary needs to be installed

* enhancement: added the dependency check
  • Loading branch information
leonsteinhaeuser committed Jul 14, 2022
1 parent e3f254e commit b002600
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions action.yml
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions 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/

0 comments on commit b002600

Please sign in to comment.