Skip to content

Install GH CLI

Install GH CLI #6

Workflow file for this run

name: "Install GH CLI"
on:
workflow_dispatch:
jobs:
pristine-install:
name: "Install GH CLI on a Pristine Container"
runs-on: ubuntu-latest
container:
image: ubuntu:latest
options: --user 0
steps:
- name: "Print git --version"
run: |
which git || echo "::warning::git does not appear to be installed"
git --version || echo "::warning::could not determine installed version of git"
- name: "Install GH CLI"
run: |
(type -p wget >/dev/null || (apt update && apt-get install wget -y))
mkdir -p -m 755 /etc/apt/keyrings
wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null
chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null
apt update
apt install gh -y
apt show gh
- name: "Print git --version"
run: |
which git || echo "::warning::git does not appear to be installed"
git --version || echo "::warning::could not determine installed version of git"
# - name: "Print .git/config"
# run: cat .git/config