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
2
votes
1 answer

How to run a workflow using github cli?

% gh workflow run test.yml gives me: could not create workflow dispatch event: HTTP 422: Workflow does not have 'workflow_dispatch' trigger (https://api.github.com/repos/bcpitutor/v2_lms/actions/workflows/20724896/dispatches) Why do I need a…
zendevil.eth
  • 974
  • 2
  • 9
  • 28
2
votes
1 answer

Gihub CLI Error: must be on a branch named differently than "master"

I want to sync staging branch with master using GitHub CLI tool (gh). So I am on the master branch locally and I run this command: gh pr create -b staging -t "master -> staging" but I receive this error: must be on a branch named differently than…
Zaid Afaneh
  • 114
  • 1
  • 10
2
votes
0 answers

"No assets to download" on Github Actions using Github CLI

Context I'm trying to download a release from a private repository in my Github Actions workflow using Github CLI gh release download command. Here is my workflow: name: Download Release Private Repo on: [push, workflow_dispatch] jobs: …
GuiFalourd
  • 15,523
  • 8
  • 44
  • 71
2
votes
1 answer

Github CLI auto-create release notes

I have a github action I use to create releases, but I want to include release notes in each one automatically as well. The end of my action runs this which is where I call the github gh CLI to create a new release: # create a new release, and…
FirstDivision
  • 1,340
  • 3
  • 17
  • 37
2
votes
1 answer

renaming a command-line git fork with gh

Goal: A jenkins pipeline that forks a repo, makes a change, pushes the change and generates a PR from master. My issue is that since this may run in parallel, I need each fork to have a unique name. The gh command-line tool seems to indicate this…
amacks
  • 80
  • 5
2
votes
1 answer

How to set gitignore file and license to None and set add "origin" git remote to Yes all at once when creating a repo via Git-CLI?

When I create a new repo using gh repo create My_Repo I am prompted with the following questions ? Visibility ? Would you like to add a .gitignore? (y/N) ? Would you like to add a license? (y/N) ? This will add an "origin" git remote to your local…
CodingRaz
  • 123
  • 8
2
votes
3 answers

Getting prompted with a GitHub Login Interface whenever I try to push to repo

this happened around 3 weeks ago, when they said https connections to GitHub would be removed. That's when this Login UI started popping whenever I tried to push, even though I provided the correct username and password, it said it's incorrect. Then…
2
votes
1 answer

how to download the archived GitHub Release Source code using GitHub Actions

I Would like to know if its possible to download the archived GitHub released source code file which is usually seen as( Source code(zip) & Source code(tar.gz) in the release pages using GitHub actions. I see lot of actions in the marketplace to…
sur
  • 345
  • 1
  • 3
  • 13
2
votes
2 answers

Rename Github repo from command line

I googled and also searched on stackoverflow for the below question, however was unable to find any satisfactory answer. So say, I have a remote repository: https://github.com//foo and I wish to rename it to…
AniketGM
  • 901
  • 1
  • 9
  • 17
2
votes
0 answers

Adding files to a github repo and attaching the file to an issue from the command line

I want to create github issues from the command line, using something like : https://cli.github.com/manual/gh_issue_create or https://docs.github.com/en/rest/reference/issues#create-an-issue but I can't find a way to do it and add attachments to…
hra1234
  • 401
  • 4
  • 11
2
votes
2 answers

Finding all GitHub Repo Deploy Keys?

I am trying to add a new SSH key to my GitHub account, but it says the key is already in use. I have hundreds of repos, and I don't want to click through each one to find out which is using this SSH key for deployments. Is there a way to automate…
reidjs
  • 149
  • 1
  • 10
2
votes
1 answer

Request PR review from team via CLI

GitHub's API has an endpoint to request reviewers for a pull request. Reviewers can be individual users (reviewers) or entire teams (team_reviewers) (teams can be created at the org level). For instance, the following will request a PR review from…
Max
  • 9,220
  • 10
  • 51
  • 83
1
vote
1 answer

GitHub CLI "gh repo clone /" keeps requesting username/password even though I am already authenticated

I am trying to clone a repository from my GitHub account. I have logged into my account using: > gh auth login --with-token < gh-token.txt > gh --version gh version 2.4.0+dfsg1 (2022-03-23 Ubuntu…
Mogur
  • 11
  • 2
1
vote
0 answers

subprocess returns different output than shell

Short context: Github's gh client adds ANSI colors to its JSON output, which is nice but makes post process hard. So if you pipe the output, gh makes a slightly different and regularly encoded output, for example: gh api organizations | cat prints…
Michael Dorner
  • 17,587
  • 13
  • 87
  • 117
1
vote
1 answer

Linux commands for login to Github CLI in command line

I want to login into the gh cli with parameters or flags. Im setting up a cloud-init file, with bash commands. So i can't interact manual processes: That's how it would look like if you do it manually in the console: ubuntu@ip-172-31-54-112:~/react$…