Fork PRs created from the GitHub Copilot app can't enable "Allow edits by maintainers" (`maintainer_can_modify` silently ignored)

オープン
#5,605 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
github, github-actions, python

調査の方向性

Start by tracing how the Copilot app provides GH_TOKEN to remote sessions and how the CLI creates fork pull requests with gh pr create. Compare the token permissions and the maintainer_can_modify value during creation and update; the issue does not name source files or tests. Done means fork PRs have maintainer edits enabled by default, or the app clearly reports when its token cannot set the option.

索引モデルが issue の本文から書いたものです。

説明

area:authentication
Describe the bug

When the Copilot agent opens a PR from the user's fork into an upstream repo (gh pr create --head <user>:<branch>, using the GH_TOKEN the GitHub Copilot app provides), the PR is created with "Allow edits by maintainers" off. Trying to turn it on afterwards with PATCH /repos/{owner}/{repo}/pulls/{n} and maintainer_can_modify=true returns success but leaves the value false. gh pr edit on the same PR fails with Resource not accessible by integration.

The token appears to be a GitHub App user token (X-OAuth-Scopes is empty). My guess is that it lacks the access to the fork that this setting needs, and GitHub drops the field without reporting an error.

Impact: maintainer and bot workflows can't push to these PRs. For example, our /fix:link-cache bot falls back to pushing to refs/pull/<n>/head and fails with ! [remote rejected] HEAD -> refs/pull/12889/head (deny updating a hidden ref).

Affected version

Copilot CLI 1.0.109, run by the GitHub Copilot app in a remote (cloud) session.

Steps to reproduce the behavior
  1. In a Copilot app session on an upstream repo where you have a fork, have the agent push a branch to the fork and run gh pr create -R <upstream> --head <user>:<branch> .... Maintainer edits aren't turned off (no --no-maintainer-edit).
  2. Run gh pr view <n> --json maintainerCanModify and get false.
  3. Run gh api -X PATCH repos/<upstream>/pulls/<n> -F maintainer_can_modify=true --jq .maintainer_can_modify. It exits 0 and prints false.
  4. Example: open-telemetry/opentelemetry.io#12889, which has maintainerCanModify: false, and its failed bot push in https://github.com/open-telemetry/opentelemetry.io/actions/runs/46047662218
Expected behavior

Fork PRs created by the agent have "Allow edits by maintainers" on, matching gh pr create's default. If the token can't set it, the agent or app reports that instead of failing silently. A setting to choose the default would also help.

Additional context
  • I couldn't find a setting for this in the app's .github/github-app.yml reference or in the cloud agent customization docs.
  • Workaround: tick the checkbox by hand on each PR.
  • Possibly related: PyGithub/PyGithub#3297 (discussion: maintainer_can_modify has no effect).
  • Side note: in the same session, gh issue create -R github/copilot-cli with the app's token also failed with Resource not accessible by integration (createIssue).
主要言語
Python
スター
11.5k
フォーク
2k
平均マージ
6時間 34分
マージ済み PR(30日)
3

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

github/copilot-cli のほかの issue

github/copilot-cli の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。