Questions tagged [github-cli]

The Github CLI ("gh") is a tool for interacting with your repositories on Github straight from the command line.

gh is GitHub on the command line. It brings pull requests, issues, and other GitHub concepts to the terminal.

Useful links:

184 questions
1
vote
2 answers

How to delete all releases and tags in a github repository

I tried the github cli: gh release list | sed 's/|/ /' | awk '{print $1, $8}' | while read -r line; do gh release delete -y "$line"; done as described here: https://dev.to/dakdevs/delete-all-releases-from-github-repo-13ad But it only works for…
Jonas Eicher
  • 1,413
  • 12
  • 18
1
vote
0 answers

git hub personal accesstoken working in local is failing in github actions

I am trying to make a GitHub action to run a bash script and create a file in the repo, then push it to a protected branch. i created a personal access token, from an admin account, tested it in my terminal by setting url git remote set-url origin…
cerofrais
  • 1,117
  • 1
  • 12
  • 32
1
vote
1 answer

Determine commit(s) from a specific date in a repo without cloning

The context here is that I'm trying to use TruffleHog to scan a list of repos in my GitHub Enterprise organisation, for hardcoded secrets. I'm using the GitHub CLI to retrieve the list of all repositories in the organisation, by running: gh repo…
Emilian Cebuc
  • 331
  • 4
  • 20
1
vote
0 answers

Github-cli codespace ssh ubuntu@localhost: permission denied (publickey,password)

I wanted to connect to my Codespace through terminal using gh or github-cli. But when I try to connect to my codespace I encounter this error. [xyz@xyzPC  ~]$ gh cs ssh ? Choose codespace: code50/93048025 (main): ideal disco ubuntu@localhost:…
8AMIUL
  • 13
  • 2
1
vote
1 answer

How to use github cli to auto pull all newly created or updated repos to local pc

How to use github cli to auto pull all newly created or updated repos to local pc? I think I need to listen for new repo creation/updation and pull the repos. How to do it with cli? If can't listen, I need to pull latest 100 repos to local machiene.…
Bsde
  • 146
  • 1
  • 2
  • 10
1
vote
1 answer

How to run a github action from command line

I need to run some Github action on my repository, but the Web-UI gives me some trouble with branch selection. How can i run action by command line?
Noam Freeman
  • 143
  • 1
  • 8
1
vote
0 answers

How to run "gh repo create" with a specific user/SSH key?

I'm struggling with git/SSH multiple identities (one personal/work and one dedicated to yet another company) I've managed to somehow create a virtual local "routing" thanks to https://simonbasle.github.io/2017/10/git-identities-and-ssh/, which…
Vadorequest
  • 16,593
  • 24
  • 118
  • 215
1
vote
2 answers

Github personal access token stops working after the first use

I'm using a personal access token to access Github from the command line, in place of a password when prompted for my username and password. If I make a new access token, it works just fine in place of my password the first time, but if I try to use…
nelazar
  • 19
  • 3
1
vote
0 answers

How to enter any input while using kaggle ipython shell commands

kaggle kernel(photo) This github cli is asking for inputs How to send any sort of input? i tried the thing visible at the attachment
1
vote
0 answers

Github cli (gh) filter repos by codeowner

We have a number of repositories within an organization but I would like to be able to filter by codeowner which is defined in .github/CODEOWNERS file like @organization_name/team_name The gh cli command I am currently using is: gh repo list…
Chris Johnston
  • 335
  • 1
  • 2
  • 16
1
vote
1 answer

GitHub CLI: Brackets Being Automatically Replaced with Dashes in Repository Name

I'm using the GitHub CLI to help me script the migration of a number of repositories from Azure DevOps to GitHib. The repository naming convention that has been used in Azure DevOps is:…
Pseudonymous
  • 839
  • 5
  • 13
1
vote
1 answer

Github CLI - create PR when not in git local repo

Using GitHub gh, how do I create a PR eg gh pr create --repo "owner/repo" --title "PR title" --body "PR body" when not CD'd to the local repo. When I run this command from an arbitrary directory, I get "failed to run git: fatal: not a git…
wavefront
  • 41
  • 3
1
vote
1 answer

Able to authenticate with SSH with Github but somehow says "key is already in use"?

I have two ssh keys i've created, first one for my personal use and the second one which I just created for work/school. When I log into using git CLI using SSH with the second SSH key, it says that i have successfully logged in like below $ winpty…
masafood
  • 325
  • 2
  • 11
1
vote
1 answer

search for a string in an unmerged PR in github

Is there a way to find the PR containing a code change from a list of unmerged PRs from all branches (even remote)? For example if one of my unmerged PRs had a string stackoverflow, how can I search for it in github?
Punter Vicky
  • 15,954
  • 56
  • 188
  • 315
1
vote
1 answer

Check if github-cli is logged in

I'm working in a bash script using the github cli to create some repos under some conditions but for that I first need to check if the user has the cli installed (and I got that check working) and if it is logged in. gh-cli provides a function gh…