Skip to content

fix: read repository merge settings over GraphQL when REST omits them - #3741

Closed
karlkeefer wants to merge 3 commits into
integrations:mainfrom
karlkeefer:repository-merge-settings-graphql
Closed

karlkeefer wants to merge 3 commits into
integrations:mainfrom
karlkeefer:repository-merge-settings-graphql

Conversation

@karlkeefer

@karlkeefer karlkeefer commented Nov 20, 2026 •

Copy link
Copy Markdown

Resolves #3382


Before the change?

  • Without push access (e.g. a GitHub App token with contents:read), the REST API omits a repository's merge settings, so every plan shows diffs like allow_squash_merge = false -> true. Clearing them means either ignore_changes, which stops managing those settings, or granting contents:write, a big jump for a CI token that only plans or detects drift.

After the change?

  • When REST omits them, the provider reads them over GraphQL, which returns them to any caller that can read the repository (as suggested on #3382). If that fails, it warns and falls back to the old behaviour.
  • Verified against a private repo with a read-only App token: v6.13.0 shows the diffs, this branch doesn't.

Written with AI assistance.

Pull request checklist

  • Schema migrations have been created if needed: not needed
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

  • Yes
  • No

@github-actions

Copy link
Copy Markdown

👋 Hi, and thank you for this contribution!

This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can.

You can help us prioritize by joining the discussion on open issues and PRs, sharing details on the changes you need, and reviewing other contributions.


🤖 This is an automated message.

@robert-crandall

Copy link
Copy Markdown
Contributor

Thanks for putting this PR together and taking the time to contribute!

We're temporarily moving to an issue-first model (see CONTRIBUTING.md) where only collaborators can open PRs while we work through the backlog. Because of that, I'm going to close this PR for now.

I've linked it on #3382 so we don't lose your work or context when we pick that issue up. Feel free to add a 👍 or any extra notes there to help us prioritize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

misleading diff (false -> true) for merge settings when authenticated with restricted GitHub App token

2 participants