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
3
votes
2 answers

How to invite a user to a private github repo within an organisation using the command line

I am trying to add users to a private Github repo within an organisation. Starting from this post, I've simply changed the API endpoint to cope with organizations (as explained here), and I end up with the following command: gh api…
greg hor
  • 682
  • 6
  • 17
3
votes
2 answers

How to get more authenticated to github-cli?

I am authenticated to github cli via token gh auth status -h lalala.com #=> lalala.com ✓ Logged in to lalala.com as lolofon (~/.config/gh/hosts.yml) ✓ Git operations for lalala.com configured to use https protocol. but, immediately executed…
user_pruser
  • 422
  • 2
  • 13
2
votes
1 answer

How to authenticate a GitHub Actions workflow as a GitHub App so it can trigger other workflows?

By default (when using the default secrets.GITHUB_TOKEN) GitHub Actions workflows can't trigger other workflows. So for example if a workflow sends a pull request to a repo that has a CI workflow that normally runs the tests on pull requests, the CI…
Sean Hammond
  • 12,550
  • 5
  • 27
  • 35
2
votes
1 answer

Problem trying to run Github CLI command gh auth login --with-token from Java

I'm having trouble automating authentication to github cli from java. I'm able to run the following from the cmd line in windows: gh auth login --with-token < C:\path\to\my\github-api-token.txt And I get the following for…
John
  • 3,458
  • 4
  • 33
  • 54
2
votes
0 answers

No .gitignore template for javascript when using "gh repo" command? (Github CLI)

I'm trying to use Github's Command Line Interface to create a new web project. When I use the gh repo command to create a new repo, why is there no option for a Javascript or Typescript .gitignore template? What kind of .gitignore do you recommend…
5Kis
  • 21
  • 1
2
votes
1 answer

Allow GitHub actions to merge PRs on protected branch

I have configured my repository so that GitHub actions are able to approve PRs I have branch protection rule, requiring 1 approval before merging. However the following step fails - name: perform the merge if applicable env: …
pkaramol
  • 16,451
  • 43
  • 149
  • 324
2
votes
1 answer

How to specify --gitignore argument in gh repo create cli command?

I'm trying to create remote repository using GitHub CLI and I can not find how to specify a particular gitignore file with argument --gitignore, say, github/gitignore/C++.gitignore. There is an error HTTP 422: Repository creation failed.…
meechie
  • 25
  • 4
2
votes
1 answer

Is it possible to connect a GitHub repo with a Vercel Project without opening a browser?

Assuming I have: GitHub and Vercel accounts already setup, Am using GitHub CLI and Vercel CLI Is it possible to connect a GitHub repo with a Vercel Project without opening the browser? I know I can create a GitHub remote repo with: gh repo create…
skube
  • 5,867
  • 9
  • 53
  • 77
2
votes
2 answers

How do I reconcile: "warning: ignoring ref with broken name refs/remotes/origin/HEAD 2"?

I am revisiting a collaborative portfolio project in Java/Spring and I have run into an issue on my local machine that I may have created a month ago. At some point I must have created HEAD 2 of refs/remotes/origin/HEAD 2. Now when I am trying to…
2
votes
2 answers

how to add a remote repo using gh cli?

I'm using the github cli (GH), and I have an already created repo, and a local git repo, is there a way to add a remote repo for that git repo using the gh cli?
Termin
  • 159
  • 2
  • 8
2
votes
2 answers

Despite being SSH Authenticated to GitHub, terminal (Bash, PWSH) Git created repo's will not Push, Fetch remote - but GitHub Desktop created will

Despite being SSH Authenticated to GitHub, terminal (Bash, PWSH) Git created repo's will not Push, Fetch remote - but GitHub Desktop created will. Date: From 16/09/22 - 18/09/22: Two days of effort. This post is subject to future edits and…
iPoetDev
  • 41
  • 8
2
votes
1 answer

How to use github api to retrieve artifacts for specific commit sha?

I am trying to build a query that would retrieve github artifacts for a given commit share for which I do know that there are runs with artifacts. I was already able to retrieve the workflow run id using the sha using something like: gh run list -b…
sorin
  • 161,544
  • 178
  • 535
  • 806
2
votes
0 answers

How to get hash of a tagged release in Github CLI?

How can I get the hash of the latest release in Github CLI? I am able to list the most recent release via the CLI with the following: gh release list --limit 1 which gives me v3.59.0 Latest (v3.59.0) about 1 day ago But it doesn't give me the…
Stretch0
  • 8,362
  • 13
  • 71
  • 133
2
votes
1 answer

GitHub CLI: command not found

I have git and gh, both installed through scoop. I set up the git authentication using gh auth login gh auth setup-git However, when trying to git fetch, I get the following error: C:\Users\[user]\scoop\apps\gh\current\bin\gh.exe auth…
ZviNeug
  • 21
  • 3
2
votes
1 answer

Ensure that a workflow in Github Actions is only ever triggered once

I have workflow that is triggered when a specific file is changed. Is it possible to ensure that this workflow is only triggered the first time that file is changed? The use case is: a repository is created from a template repository to initialize…
Knud Möller
  • 132
  • 10
1 2
3
12 13