Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
January 16, 2022 09:15 am GMT

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:

Installation of GitHub CLI on Gitpod

Setting up the Workflow:

  • Create a empty file under .github/workflows/ named as github-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

Workflow Enabled

  • To Run the Workflow:

    gh workflow run demo

Here demo was my workflow name, you can replace it with your workflow's name.

Workflow Run

On GitHub Dashboard:

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.

Run List

  • Specific Result of any run ID:

    gh run view 1703727006

1703727006 is ID, replace it with your workflow run ID.

Github workflow run view

Similarly, You Can Run all GitHub CLI Commands in GitPod (gh cli commands)

Contribute in the browser using Gitpod

GitHub logo 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

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To