cli/pkg/cmd
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
..
actions Remove trailing whitespace 2025-02-13 11:06:27 +05:00
alias Inconsistent format of examples in help text 2025-02-27 16:26:25 +05:00
api Inconsistent format of examples in help text 2025-02-27 16:26:25 +05:00
attestation Update pkg/cmd/attestation/verification/attestation.go 2025-03-05 07:31:35 -07:00
auth Inconsistent format of examples in help text 2025-02-27 16:26:25 +05:00
browse Inconsistent format of examples in help text 2025-02-27 16:26:25 +05:00
cache Inconsistent format of examples in help text 2025-02-27 16:26:25 +05:00
codespace Merge pull request #10508 from iamazeem/10449-inconsistent-examples-format 2025-02-27 09:15:14 -05:00
completion Remove trailing whitespace 2025-02-13 11:06:27 +05:00
config Inconsistent format of examples in help text 2025-02-27 16:26:25 +05:00
extension Merge pull request #10508 from iamazeem/10449-inconsistent-examples-format 2025-02-27 09:15:14 -05:00
factory Refactor remote resolver caching tests 2025-02-20 13:15:56 +01:00
gist Merge pull request #10508 from iamazeem/10449-inconsistent-examples-format 2025-02-27 09:15:14 -05:00
gpg-key Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
issue Inconsistent format of description of flags (starting with lowercase letter) (#10507) 2025-02-27 11:40:21 +01:00
label Inconsistent format of examples in help text 2025-02-27 16:26:25 +05:00
org Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
pr Merge pull request #10512 from cli/wm-kw/fix-pr-checkout-for-forks 2025-02-28 13:31:59 +01:00
project Update project help text; fix unlink usage 2025-02-27 17:51:05 +05:00
release Inconsistent format of examples in help text 2025-02-27 16:26:25 +05:00
repo Make missing workflow regexp aware of GitHub App 2025-03-11 02:38:51 +00:00
root Inconsistent format of examples in help text 2025-02-27 16:26:25 +05:00
ruleset Remove trailing whitespace 2025-02-13 11:06:27 +05:00
run Inconsistent format of examples in help text 2025-02-27 16:26:25 +05:00
search Inconsistent format of examples in help text 2025-02-27 16:26:25 +05:00
secret Fix secret command panic when base repo from cwd 2025-03-06 11:45:22 +01:00
ssh-key Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
status Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
variable Merge branch 'trunk' into tab-indents 2024-08-06 13:08:48 -04:00
version Fix --version flag printing to stdout 2022-05-24 16:21:13 +02:00
workflow Fix unhandled panic in FindWorkflow and add tests 2025-02-28 15:11:53 -08:00