cli/pkg/cmd/repo
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
..
archive Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
autolink Improve http error test cases 2025-02-07 16:51:19 -05:00
clone Update tests 2025-02-11 10:34:10 +05:00
create Inconsistent format of examples in help text 2025-02-27 16:26:25 +05:00
credits Inconsistent format of examples in help text 2025-02-27 16:26:25 +05:00
delete Inconsistent format of description of flags (starting with lowercase letter) (#10507) 2025-02-27 11:40:21 +01:00
deploy-key Inconsistent format of examples in help text 2025-02-27 16:26:25 +05:00
edit Inconsistent format of examples in help text 2025-02-27 16:26:25 +05:00
fork Update tests 2025-02-11 10:34:10 +05:00
garden Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
gitignore Inconsistent format of examples in help text 2025-02-27 16:26:25 +05:00
license Inconsistent format of examples in help text 2025-02-27 16:26:25 +05:00
list Test json flags for repo view and list 2024-10-22 13:38:51 +02:00
rename Merge pull request #10429 from iamazeem/8404-standardize-urls 2025-02-13 10:49:18 -08:00
setdefault Merge pull request #10508 from iamazeem/10449-inconsistent-examples-format 2025-02-27 09:15:14 -05:00
shared Reverse repo/shared package name change 2024-10-09 20:49:29 -06:00
sync Make missing workflow regexp aware of GitHub App 2025-03-11 02:38:51 +00:00
unarchive Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
view Update test to be compatible with latest Glamour v0.8.0 2025-01-22 20:13:40 -08:00
repo.go Introduce repo autolinks list commands 2024-12-27 21:36:16 -05:00