File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,12 +19,10 @@ action:
1919 exit 0
2020 fi
2121 echo "Installing GitHub CLI..."
22- (type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y))
23- sudo mkdir -p -m 755 /etc/apt/keyrings
24- out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg && cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null
25- sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
26- echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
27- sudo apt update && sudo apt install gh -y
22+ GH_VERSION=$(curl -s https://api.github.com/repos/cli/cli/releases/latest | grep -oP '"tag_name":\s*"v\K[^"]+')
23+ curl -sL "https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_linux_amd64.tar.gz" | tar xz -C /tmp
24+ sudo mv "/tmp/gh_${GH_VERSION}_linux_amd64/bin/gh" /usr/local/bin/gh
25+ rm -rf "/tmp/gh_${GH_VERSION}_linux_amd64"
2826 echo "gh version: $(gh --version | head -1)"
2927 - task :
3028 command : |
Original file line number Diff line number Diff line change @@ -19,12 +19,10 @@ action:
1919 exit 0
2020 fi
2121 echo "Installing GitHub CLI..."
22- (type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y))
23- sudo mkdir -p -m 755 /etc/apt/keyrings
24- out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg && cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null
25- sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
26- echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
27- sudo apt update && sudo apt install gh -y
22+ GH_VERSION=$(curl -s https://api.github.com/repos/cli/cli/releases/latest | grep -oP '"tag_name":\s*"v\K[^"]+')
23+ curl -sL "https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_linux_amd64.tar.gz" | tar xz -C /tmp
24+ sudo mv "/tmp/gh_${GH_VERSION}_linux_amd64/bin/gh" /usr/local/bin/gh
25+ rm -rf "/tmp/gh_${GH_VERSION}_linux_amd64"
2826 echo "gh version: $(gh --version | head -1)"
2927 - task :
3028 command : |
You can’t perform that action at this time.
0 commit comments