Skip to content

Commit 4e019bf

Browse files
committed
Install GH CLI on Ubuntu runner
1 parent f62e2b5 commit 4e019bf

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

.github/workflows/trigger-package-and-publish.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,15 @@ jobs:
2222

2323
- name: Install GitHub CLI (Ubuntu)
2424
run: |
25-
sudo curl -fsSLo /usr/share/keyrings/githubcli-archive-keyring.gpg https://cli.github.com/packages/githubcli-archive-keyring.gpg
26-
echo "Types: deb URIs: https://cli.github.com/packages Suites: stable Components: main Architectures: $(dpkg --print-architecture) Signed-By: /usr/share/keyrings/githubcli-archive-keyring.gpg" | sudo tee /etc/apt/sources.list.d/github-cli.sources > /dev/null
27-
sudo apt update
28-
sudo apt install gh -y
29-
gh --version
30-
31-
- name: Install DNF Config Manager
32-
run: |
33-
sudo dnf -y install 'dnf-command(config-manager)'
34-
35-
- name: Install GitHub CLI
36-
run: |
37-
sudo dnf -y config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
38-
sudo dnf -y install gh
25+
(type -p wget >/dev/null || (sudo apt update && sudo apt install wget -y)) \
26+
&& sudo mkdir -p -m 755 /etc/apt/keyrings \
27+
&& out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
28+
&& cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
29+
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
30+
&& sudo mkdir -p -m 755 /etc/apt/sources.list.d \
31+
&& 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 \
32+
&& sudo apt update \
33+
&& sudo apt install gh -y
3934
gh --version
4035
4136
- name: Authenticate GitHub CLI Using Access Token

0 commit comments

Comments
 (0)