- name: Apply security updates via SSH env: SSH_PRIVATE_KEY: $ secrets.SSH_PRIVATE_KEY run: | for host in $(cat inventory.txt); do ssh -o StrictHostKeyChecking=no -i <(echo "$SSH_PRIVATE_KEY") ubuntu@$host \ 'sudo apt update && sudo apt upgrade -y -s | grep -i security && sudo apt upgrade -y' done
sudo mkdir -p -m 755 /etc/apt/keyrings curl -fsSL https://github.com | sudo gpg --dearmor -o /etc/apt/keyrings/githubcli-archive-keyring.gpg sudo chmod 644 /etc/apt/keyrings/githubcli-archive-keyring.gpg Use code with caution. Step 3: Add the Official Repository
If you are behind a corporate proxy, add-apt-repository might hang or fail. github for ubuntu upd
GitHub CLI ( gh ) brings the full power of GitHub directly to your Ubuntu terminal. It allows you to manage repositories, issues, pull requests, and workflows without leaving the command line. This comprehensive guide covers how to install, configure, and update the GitHub CLI on Ubuntu systems. Why Use GitHub CLI ( gh ) Instead of Standard Git?
Press Enter to open your default browser, paste the code, and click . Method B: Generating and Updating SSH Keys Manually - name: Apply security updates via SSH env:
: Much faster for managing GitHub-specific tasks than visiting the website.
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg 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 It allows you to manage repositories, issues, pull
Interact with the GitHub REST and GraphQL APIs easily. How to Install GitHub CLI on Ubuntu
gh --version
: Export your proxy settings before running the command, or add the repository manually to /etc/apt/sources.list . Issue 3: Merge Conflicts After Git Update