cli/pkg/cmd/repo/sync
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
..
git.go Rename backwards compatible credentials pattern 2024-11-27 12:21:55 +01:00
http.go Make missing workflow regexp aware of GitHub App 2025-03-11 02:38:51 +00:00
mocks.go gh repo sync should be able to sync a local branch with an upstream remote (#8229) 2023-11-20 10:37:59 +00:00
sync.go Fix doc typo for repo sync 2024-08-23 00:17:31 +08:00
sync_test.go Make missing workflow regexp aware of GitHub App 2025-03-11 02:38:51 +00:00