An Interest In:
Web News this Week
- April 2, 2024
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
GitHub CLI on GitPod
What is GitHub CLI?
It is GitHubs official command line tool. It brings pull requests, issues, and other GitHub concepts to the terminal next to where you are already working with git and your code.
So, Recently GitHub CLI made a new update to Run Your GitHub Workflow Files through Command Line.
What is GitPod?
Gitpod is an open-source Kubernetes application for ready-to-code developer environments that spins up fresh, automated dev environments for each task, in the cloud, in seconds. It enables you to describe your dev environment as code and start instant, remote and cloud-based developer environments directly from your browser or your Desktop IDE.
Open Your GitHub Repository in Gitpod:
just add this prefix following to your github repository: https://gitpod.io/#
Example: https://gitpod.io/#https://github.com/GITHUB_USERNAME/REPOSITORY_NAME/
GitHub CLI Setup at Gitpod (official docs):
Run Following Commands:
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpgecho "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/nullsudo apt updatesudo apt install gh
sudo apt updatesudo apt install gh
Output:
Setting up the Workflow:
Create a empty file under
.github/workflows/
named asgithub-action-demo.yml
File Content:
name: Demoon:# Triggers the workflow on push or pull request events but only for the main branchpull_request: branches: [main]# Allows you to run this workflow manually from the Actions tabworkflow_dispatch:jobs:cli-gitpod: name: CLI and Gitpod Demo runs-on: ubuntu-latest steps: - name: Hello From Gitpod run: | echo "Hello! From Gitpod "
Login with gh cli
Run:
gh auth login
Complete whole step and login.
Test & Run GitHub Workflow with gh cli:
To View the list of your workflows:
gh workflow list
you Will not see anything, because you first have to enbale that workflow.
To Enable the workflow:
gh workflow enable
To Run the Workflow:
gh workflow run demo
Here
demo
was my workflow name, you can replace it with your workflow's name.
On GitHub Dashboard:
run history list & analysis:
gh run list --workflow=github-action-demo.yml
github-action-demo.yml
is the filename, replace it with your workflow's filename.
Specific Result of any run ID:
gh run view 1703727006
1703727006
is ID, replace it with your workflow run ID.
Similarly, You Can Run all GitHub CLI Commands in GitPod (gh
cli commands)
Siddhant-K-code / github-cli-on-gitpod
Test GitHub CLI on Gitpod
What is GitHub CLI?
It is GitHubs official command line tool. It brings pull requests, issues, and other GitHub concepts to the terminal next to where you are already working with git and your code.
So, Recently GitHub CLI made a new update to Run Your GitHub Workflow Files through Command Line.
What is GitPod?
Gitpod is an open-source Kubernetes application for ready-to-code developer environments that spins up fresh, automated dev environments for each task, in the cloud, in seconds. It enables you to describe your dev environment as code and start instant, remote and cloud-based developer environments directly from your browser or your Desktop IDE.
Open Your GitHub Repository in Gitpod:
just add this prefix following to your github repository: https://gitpod.io/#
Example: https://gitpod.io/#https://github.com/GITHUB_USERNAME/REPOSITORY_NAME/
GitHub CLI Setup at Gitpod (official docs):
Run Following Commands:
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpgecho "deb [arch=$(dpkg --print-architecture
Original Link: https://dev.to/siddhantkcode/github-cli-on-gitpod-4e84
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To