This helps avoid the errors when a new commit from upstream is not yet
available in the fork, resulting in a HTTP 404 when trying to update the
ref in the fork.
If the merge-upstream API is unavailable (404) or errors out (409/422),
the functionality falls back to the previous functionality of manually
updating refs. This ensures that `--force` still has effect.
- Store multiple secrets in parallel
- Perform repo ID resolution in parallel with looking up the encryption key
- Avoid resolving repo IDs more than once
- Allow passing `--env-file=-` to read from stdin
- Fix storing user secrets from file
Allows to set multiple secrets from an env file.
gh secret set -f secrets.env
The env file follows a simple format as defined in https://github.com/joho/godotenv
SPAM=eggs
FOO="bar"
Update labels using the `addLabelsToLabelable` and
`removeLabelsFromLabelable` mutations instead of via the `updateIssue`
mutation that replaces the entire set of labels. This prevents the edit
operation from clobbering any unseen changes to the list of labels.
Co-authored-by: Mislav Marohnić <mislav@github.com>
Adds a new command `gh auth setup-git [<hostname>]` that sets up git to
use the GitHub CLI as a credential helper.
The gist is that it runs these two git commands for each hostname the
user is authenticated with.
```
git config --global --replace-all 'credential.https://github.com.helper' ''
git config --global --add 'credential.https://github.com.helper' '!gh auth git-credential'
```
If a hostname flag is given, it'll setup GH CLI as a credential helper
for only that hostname.
If the user is not authenticated with any git hostnames, or the user is
not authenticated with the hostname given as a flag, it'll print an
error.
Co-authored-by: Mislav Marohnić <mislav@github.com>
In the absence of an explicit `--color` setting, or when `--color=auto`
is passed, the pr diff command should fall back to respecting the global
colorization setting as inferred from the environment.
The `zipball_url` and `tarball_url` fields on the Release API payload
always link to "legacy" archives that are of a different format than
those one would get if they downloaded an archive from a Release using
the web interface. The GitHub API does not seem to publish links to
non-legacy archives.
This adds a redirect hack to turn "legacy" Codeload URLs into non-legacy
ones with the goal of ensuring the consistency of user experience when
downloading archives.
- Supports passing a PR as argument, not just issues
- Makes it non-fatal when project cards were not able to load
- Cleans up legacy method for fetching issues
The `codespace code` command used the `skratchdot/open-golang` library
to open `vscode://` URLs, which uses `xdg-open` for Linux under the
hood, which isn't available under WSL.
This switches over to using the `cli/browser` package which has explicit
support for WSL by invoking `wslview` when found.
- doing mkdir before `git init <dir>` is not necessary; git will
create the directory if it doesn't exist
- passing both `-C` and `--git-dir` is not needed for git invocations
- reading the current working directory isn't necessary for specifying
nested paths to operate in
- use `git add .` instead of explicitly naming all paths; we generate a
gitignore for binaries that we want to avoid adding
- generate cross-platform gitignore for Go binary extensions
- add helpers to simplify writing files, tests