Commit graph

649 commits

Author SHA1 Message Date
Andy Feller
918cafc222 Deprecate ColorScheme.Gray for ColorScheme.Muted
This commit converts all of the places using ColorScheme.Gray and ColorScheme.Grayf to Muted and Mutedf.

There is a little extra tidying up with local variable names or converting code to use Mutedf format.
2025-04-06 10:18:48 -04:00
Andy Feller
d2cd14b4cd Remove out of scope changes, update list commands
After discussing this with the team, the `gh config` changes to display `accessible_colors` have been removed from this branch being outside of acceptance criteria.  This will be moved to a separate issue along with any other work needed to finalize the public preview such as `gh help` entries for `GH_ACCESSIBLE_COLORS` environment variable.

List commands that use ColorScheme.Gray have been updated to use ColorScheme.Muted.
2025-03-31 11:58:30 -04:00
Kynan Ware
c1fbc2f05b test(many): fix whitespace in tests expectations
Due to https://github.com/charmbracelet/glamour/pull/334, the margin
used for markdown rendering has changed by a couple spaces. This
corrects the relevant tests to accomodate that change.
2025-03-27 14:21:13 -06:00
Kazuma Watanabe
b01288617a Make missing workflow regexp aware of GitHub App
Follow up of https://github.com/cli/cli/pull/7612

The `missingWorkflowScopeRE` is defined to capture
the error message when the `GH_TOKEN` does not have
`workflow` scope in `gh repo sync <remote>`,
but this is only intended for error messages for
OAuth Apps and does not work with GitHub Apps.

In GitHub App, you will get the following error:

```
{
  "message": "refusing to allow a GitHub App to create or update workflow `.github/workflows/teamcity-pr-checks.yml` without `workflows` permission",
  "documentation_url": "https://docs.github.com/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository",
  "status": "422"
}
```

As you can see above, the existing regexp does not
match the "`workflows` permission".

This change modifies the regexp to return
the user-friendly error message when the `workflow`
permission is missing, even in the case of a GitHub App.
2025-03-11 02:38:51 +00:00
Andy Feller
f9d50d86ac
Merge pull request #10508 from iamazeem/10449-inconsistent-examples-format
Inconsistent format of examples in help text
2025-02-27 09:15:14 -05:00
Azeem Sajid
33c30d5bd1 Inconsistent format of examples in help text 2025-02-27 16:26:25 +05:00
Azeem Sajid
69fff52026
Inconsistent format of description of flags (starting with lowercase letter) (#10507) 2025-02-27 11:40:21 +01:00
Azeem Sajid
0fb87903e5 Update usage to lower-kebab-case 2025-02-14 22:12:22 +05:00
Tyler McGoffin
e047d4a611
Merge pull request #10429 from iamazeem/8404-standardize-urls
Standardize URLs
2025-02-13 10:49:18 -08:00
Azeem Sajid
f9428e7905 Update tests 2025-02-13 11:09:57 +05:00
Azeem Sajid
8b7fb231ec Remove trailing whitespace 2025-02-13 11:06:27 +05:00
Azeem Sajid
026f64ce6f Standardize URLs 2025-02-13 10:41:53 +05:00
Andy Feller
cdb44f8298
Merge pull request #10334 from iamazeem/9132-gh-repo-view-set-default
[gh repo view] Improve error message for forked repo
2025-02-12 09:55:13 -05:00
Azeem Sajid
eb44ec2d86 Update tests 2025-02-11 10:34:10 +05:00
Azeem Sajid
cdc7cae29c Address review comments 2025-02-11 09:35:16 +05:00
Michael Hoffman
8e2be7326b Improve http error test cases 2025-02-07 16:51:19 -05:00
Michael Hoffman
9eaaf44516 Handle non-TTY behavior 2025-02-07 16:27:04 -05:00
Michael Hoffman
7a5b49a4c4
Merge branch 'trunk' into delete-autolinks 2025-02-06 09:53:09 -05:00
Tim Rogers
430e5abe25
Drop accidental help text change 2025-02-03 12:04:42 +00:00
Tim Rogers
6c21ab2284
Error when gh repo rename is used with a new repo name that contains an owner
`gh repo rename` can only rename a repo, but not change its owner
(i.e. transfer it).

As flagged in #10034, at the moment, the CLI behaves like it can do
this, and produces weird results.

If I ask to rename my repo to `polyseam/frappe-containers`:

```bash
gh repo rename polyseam/frappe-containers
```

..the preview suggests that it will do the right thing:

```
? Rename polyseam/containers to polyseam/frappe-containers? Yes
```

...but the repo gets renamed wrongly:

```
✓ Renamed repository polyseam/polyseam-frappe-containers
```

This adds an upfront validation that looks for a slash and tells
you that the command can't transfer a repo.

Fixes #10034.
2025-02-03 11:49:21 +00:00
Michael Hoffman
d5adafd3fb Rename staggler 2025-02-02 21:46:56 -05:00
Michael Hoffman
a1ae68b4f4 Formatting 2025-02-02 21:37:34 -05:00
Michael Hoffman
021557912d AuoLink -> Autolink 2025-02-02 21:34:03 -05:00
Michael Hoffman
0b3efede35 Use http constants 2025-02-02 21:12:49 -05:00
Michael Hoffman
f907ad9f97 refac and some spacing in output 2025-02-02 20:50:37 -05:00
Michael Hoffman
7325944040 More consistency 2025-02-02 20:31:12 -05:00
Michael Hoffman
0274999880 whitespace 2025-02-02 20:22:51 -05:00
Michael Hoffman
dcc1efa2bd clean up 2025-02-02 20:22:16 -05:00
Michael Hoffman
fc5a6d1c3f Autolink delete http tests 2025-02-02 20:09:49 -05:00
Michael Hoffman
e226a79dc5 Autolink delete tests 2025-02-01 15:46:09 -05:00
Michael Hoffman
908513f97f Initial working implementation 2025-02-01 11:09:00 -05:00
Michael Hoffman
b23cf6e8d7 Update formatting for autolink output 2025-01-29 16:24:47 -05:00
Michael Hoffman
e4d720ba22 Remove redundant error check 2025-01-29 11:12:28 -05:00
Andy Feller
fe21e10ae8 Keeping autolink IDs the same in all test cases 2025-01-29 10:16:02 -05:00
Andy Feller
af538b277d Expand test case
- add autolink view case for numeric
- simplifying local variable usage
2025-01-29 10:10:42 -05:00
Michael Hoffman
21a5267be4 Remove unused test field 2025-01-29 09:35:05 -05:00
Michael Hoffman
8b7d6d1b3f Remove unused test field 2025-01-29 09:34:29 -05:00
Michael Hoffman
8f55dbcf61 Error case test for viewRun 2025-01-28 14:07:48 -05:00
Michael Hoffman
32ee4db484 Autolink view HTTP tests 2025-01-28 13:33:50 -05:00
Michael Hoffman
58d84a4088 Shorten description 2025-01-28 12:03:03 -05:00
Michael Hoffman
11ce0c661c Updates following renaming domain to shared 2025-01-28 11:43:57 -05:00
Michael Hoffman
f941608091 Partial testing for view 2025-01-28 11:43:57 -05:00
Michael Hoffman
e8475d9fb8 Initial, working implementation 2025-01-28 11:43:57 -05:00
Andy Feller
7c31d1a76b Minor refactoring autolink create help and logic
- simplified and wrapped `gh repo autolink create` and `gh repo autolink` long help usage docs
- simplified success message, brought into alignment with other commands
2025-01-27 17:47:55 -05:00
Michael Hoffman
363bfd9520
Merge branch 'trunk' into create-autolinks 2025-01-23 12:55:30 -05:00
Otto Kekäläinen
b19e682455
Update test to be compatible with latest Glamour v0.8.0
Latest Glamour has slightly changed logic in line length / wrapping,
resulting test failures due to string mismatch. Update tests and bump
dependency to v0.8.0, and others to the bare minimal level as generated
by `go mod tidy`.

This was detected then building the GitHub cli package `gh` in Debian
started to fail with src:golang-github-charmbracelet-glamour 0.8.0-1.

Closes: #10179
2025-01-22 20:13:40 -08:00
William Martin
1bd07b9477
Merge pull request #10279 from mikelolasagasti/go-1.24-printf
Bump golangci-linter and address failures to prepare for Go 1.24 strictness
2025-01-22 12:08:39 +01:00
William Martin
0a3706a404 Remove unncessary printf usage 2025-01-21 18:04:47 +01:00
Mikel Olasagasti Uranga
4396e40a31 Fix: Ensure constant format strings in fmt and printf calls
Go 1.24 introduces stricter checks for format string validation.
This commit fixes instances where non-constant format strings were
used in calls to functions like `fmt.Errorf`, `fmt.Printf`, and similar.

Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
2025-01-20 16:27:27 +01:00
Wing
0be5720c1c Update setdefault test 2025-01-15 14:55:17 +01:00