Skip to content

Commit 39fa9d1

Browse files
committed
Fix GitHub CLI installation: add sudo to apt-get commands
- Add sudo to all apt-get commands in GitHub Actions workflow - Fixes permission denied error when installing GitHub CLI - Required for package installation in GitHub Actions runners
1 parent fd4819b commit 39fa9d1

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

.github/workflows/check-docs-updates.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ jobs:
7171
7272
- name: Install GitHub CLI
7373
run: |
74-
type -p curl >/dev/null || apt-get update && apt-get install -y curl
75-
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
76-
chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
77-
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null
78-
apt-get update
79-
apt-get install -y gh
74+
type -p curl >/dev/null || sudo apt-get update && sudo apt-get install -y curl
75+
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
76+
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
77+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
78+
sudo apt-get update
79+
sudo apt-get install -y gh
8080
8181
- name: Configure GitHub CLI
8282
env:

0 commit comments

Comments
 (0)