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

Invite members to GitHub org using Email ID through commandline or API

I was using following GitHub CLI command to add new member to a GitHub org through the command line. I am using the username to add: # GitHub CLI api # https://cli.github.com/manual/gh_api gh api \ --method PUT \ -H "Accept:…
0
votes
0 answers

Can 'gh auth' settings be set on individual repos?

My enterprise is locked down to Enterprise credentials, so when I use my personal repos, I have to execute gh auth login to enable that repo, and if I am working on enterprise repos simultaneously in other windows, I have to execute that again there…
DrStrangepork
  • 2,955
  • 2
  • 27
  • 33
0
votes
0 answers

Unable to run github cli in interactive mode

I am trying to create a repo using GitHub cli the command that I've used is gh repo create but I am getting the following error --public`, `--private`, or `--internal` required when not running interactively Usage: gh repo create…
0
votes
6 answers

JQ: filter nested array of objects in only include selected fields

Starting with the following, I just want the .title, .url, .author.login, .reviews.author.login, .reviews.state and .mergedBy.login fields? I'm getting close with map({ title: .title, URL: .url, author: .author.login, reviews: .reviews, "merged by":…
David Williams
  • 401
  • 3
  • 15
0
votes
1 answer

List files in repo using `gh` from GitHub CLI?

Is there a gh command to list files in a directory without having a working copy clone? I have found a git command that will do it, but I think this is working only on the local working copy. git ls-tree --name-only HEAD git ls-tree --name-only -r…
lit
  • 14,456
  • 10
  • 65
  • 119
0
votes
0 answers

gh cli api returns 404 but auth and token scopes are OK

I have the latest gh CLI app. I set a GH_TOKEN. It seems to be working, because this works: gh api --method GET -H "Accept: application/vnd.github.v3+json" "orgs/MyOrg/repos" ...it returns a few repos. But this call returns a 404: gh api --method…
GaryO
  • 5,873
  • 1
  • 36
  • 61
0
votes
1 answer

Why can I only add nested teams to repositories on GitHub through command line

I am trying to add several teams to my repository but it gives me a Not Found (HTTP 404 error). The teams are specifically an LDAP group Here is the basic command Line for adding teams to a repo with special permission: gh api --method PUT…
DevopitionBro
  • 111
  • 1
  • 6
0
votes
1 answer

Github-Actions: link pull request to issue

I'm quite a rookie with GitHub Actions so this might be a stupid question: Is there a way to link pull requests with issues (in the UI linked PRs are shown under Development) in Github Actions using Github CLI or octokit/rest.js via…
0
votes
0 answers

Github CLI or API, can I see which commit a Github Action workflow was run on?

Using Github's CLI tool, I can see a Github Action workflow's log by gh run view [ID] --log Submitting the ID of a run, this returns the run's log. Now, if I don't have the ID, is there any way to find out from a commit SHA, if there are any GH…
michpohl
  • 852
  • 8
  • 30
0
votes
1 answer

Adding an asset to a release through GitHub action triggered on release creation

We have a GitHub Actions workflow triggered by the creation of a release, i.e., on: release: types: [created] How can we add the built files to the triggereing release as an asset from within the workflow? I have seen this answer recommending…
0
votes
1 answer

Github CLI auth refresh command is not opening in browser

I'm trying to use this command `gh auth refresh -h github.com -s codespace` it works fine but when it says *"Press Enter to open github.com in your browser"* and when I do it just load the html content inside my terminal. e.g Skip to content This…
Justin
  • 107
  • 3
  • 10
0
votes
1 answer

Cloud-init File Command line option 'S' [from -fsSL] is not understood in combination with the other options

i want to execute this cloud-init file and terraform file: Cloud-init: #cloud-config runcmd: - mkdir react - cd react - type -p curl >/dev/null || sudo apt install curl -y curl -fsSL…
0
votes
0 answers

Linux commands for running github workflow for GH CLI in command line

i want to run a workflow with no user interaction needed in the command line with ubuntu. I installed gh on my ec2 instance and already logged in successfully without any user interaction needed. Can i do the same with the gh workflow run? I only…
0
votes
0 answers

gh release create TAG aws codecommit equivalent

Anyone know of a gh release create TAG aws codecommit equivalent? I'm looking for a way on AWS to track the exact state of the repo per a release number I'd keep in line with app build numbers, as in when releasing the app on Store, hit release…
0
votes
1 answer

Bash script to automate to adding multiple members to multiple teams using GitHub REST API

I am using following command to add or remove users in to GitHub teams . where username , orgname, team name and role are passed as arguments. gh api \ --method PUT \ -H "Accept: application/vnd.github+json" \ …