Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: install gh cli if not present #39

Merged
merged 2 commits into from Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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/