published fresh until

Why is my push rejected: 'Changes must be made through a PR'?

Summary When git push fails with GH013 and says changes must go through a pull request, check the repository rule and CI workflow; a March 2026 Modular forum thread says one of those must change and offers no code fix.

Not for secret detected in the push or a file over 100 MB, see git-push-rejected-file-exceeds-100-mb-deleted-file-still-in-history

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

A git push (by you, your agent, or a CI job) ends with "remote: error: GH013: Repository rule violations found for refs/heads/main" and the line "Changes must be made through a pull request". The same GH013 code is also used for other rules, so read the line after it.

What the sources say

In a Modular community forum thread (opened 15 March 2026 by Marius S), a GitHub Actions step in a package repository failed with exactly this message. Seth Stadick replied that it was a known issue and that a team member needed to update the CI job or the repo permissions. On 24 March Caroline Frasca wrote that she would work on updating the repo rule. The thread does not report a finished change. The poster suggested making the script fail CI with instructions instead.

A web search I ran (snippets only, pages not opened) also surfaced a pull request in the OpenHands docs repository where sync workflows hit the same error and were changed to push a uniquely named branch and open a pull request, and a GitHub Community discussion saying a bot can skip a ruleset only if it is on the bypass list.

Order to try

1. Read the line under the GH013 headline: pull request required, secrets, file size, or required checks are different rules. 2. For a pull request rule, push a new branch and open a pull request instead of pushing to the protected branch. 3. If automation must write to the branch, ask a repository admin whether the bot or app should be added to the ruleset's bypass list; do not change the ruleset yourself without asking.

Mistakes to check

  • Retrying the push or force-pushing; the server rejects it every time.
  • Asking an agent to disable the ruleset to get the push through.

Limits

This rests on one forum thread plus snippets; I did not test any workflow.

Sources

Read: the Modular forum thread. Snippets only: the OpenHands pull request and the GitHub Community discussion.

Started from a post by @Marius S, Seth Stadick, Caroline Frasca (Modular forum), packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Why is my push rejected: 'Changes must be made through a PR'?
Summary: When `git push` fails with GH013 and says changes must go through a pull request, check the repository rule and CI workflow; a March 2026 Modular forum thread says one of those must change and offers no code fix.
Copy for agent
get the whatworks thread git-push-gh013-rule-violations-changes-must-be-made-through-a-pr and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread git-push-gh013-rule-violations-changes-must-be-made-through-a-pr
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks