pr-merge-audit
Merge-tests the open pull requests of a repository against its base branch and writes a Markdown report of which PRs combine cleanly, which conflict, and which break each other's tests.
No AI or network is involved after the snapshot step: the same snapshot, configuration and machine always produce the same report. The tool is not tied to any project, language or test runner; everything about the repository under test is in a configuration file kept with that project.
Requirements
- Python 3.9 or later, standard library only.
- git 2.38 or later (
git merge-tree --write-tree). - Linux, macOS or Windows.
- Setup, test and probe commands run without network by default. That works on macOS, on Linux
where unprivileged user namespaces are allowed, and on a machine or container with no network;
elsewhere, including Windows, set
"network": "allowed". See Configuration. - For
snapshotonly: GitHub (github.com, or GitHub Enterprise). Optional:GITHUB_TOKENin the environment (unauthenticated API access is rate-limited). For other hosts, see Other hosts.
Install
pip install pr-merge-audit
pr-merge-audit --help
or run python3 pr_merge_audit.py from a clone; it has no dependencies and takes the same
arguments.
How it works
- Freeze the PRs.
snapshotsaves every open PR's head commit, changed files, draft flag and check status, plus every commit involved, so the build can be re-run later even after branches move or are deleted. - Pick the PRs to try. Drafts, PRs whose required check did not pass, PRs that change no tests, and PRs you exclude in the config are skipped, each with its reason.
- Merge them one by one.
buildmerges each PR onto the base in order and runs your tests after each merge. A PR that conflicts or fails is backed out; a failure that passes on a re-run is marked flaky. - Find out why. For a conflicting PR, the PRs it conflicts with are swapped out and the tests run again. For a failing PR, the merge sequence is bisected for the PR that breaks it, and that pair is tested alone on the base.
- Write the report.
reportturns the results into Markdown: what merged, what conflicted or failed and the culprit where one was found, the test runs each phase used, and how many runs landing the PRs one at a time would have needed.
The tests of every PR run as you. Run builds on a disposable machine or container that holds no credentials. See Security.
Commands
pr-merge-audit --config CONFIG snapshot freeze PR heads and metadata (GitHub)
pr-merge-audit --config CONFIG build --snapshot FILE merge-test offline, write results
[--emit-branch REF --emit-repo PATH] also keep the merged build as a branch
[--ignore-status] [--out FILE]
[--merge-only] only merge: no tests, no PR code run
pr-merge-audit report --results FILE [--out FILE] render the Markdown report
pr-merge-audit verify --results FILE [--golden FILE] check the report renders the same
pr-merge-audit --config CONFIG estimate --snapshot FILE --reference FILE rough running time here
See Commands for what each one does.
Quick start
pip install pr-merge-audit
mkdir myproject && cd myproject
curl -so config.json https://raw.githubusercontent.com/jacob-adm/pr-merge-audit/main/config.example.json
# edit config.json: repo, remote, base and test_cmd (see Configuration)
pr-merge-audit --config config.json snapshot
pr-merge-audit --config config.json build --snapshot snapshots/DATE.json
pr-merge-audit report --results results/DATE.json --out reports/DATE.md
To see only which PRs conflict, without running any PR's code, add --merge-only to build. It
needs no test_cmd and tries every open PR, so it is a safe first run on a repository.
DATE is the UTC date of the snapshot. Paths are relative to the current directory, so keep
each project's config, snapshots and results in a directory of its own.
Documentation
- How it works: each step of the build, and what makes it deterministic.
- Commands: each command, snapshots from other hosts, and keeping the merged build as a branch.
- Configuration: every config key, and probes.
- Timings: what a build costs in test runs, estimating it, the serial-landing comparison and a measured build.
- Security: what runs as you, and what the tool does to limit damage.
- Testing: the test suite and the golden-report self-check.
- Using it with other tools: landing a batch with git-overlap first and git surface on the kept branch.
- Contributing: how the project is developed and what is enforced.
- Reporting a vulnerability
License
Apache License 2.0; see LICENSE.
Metadata
Release files for pr-merge-audit 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pr_merge_audit-2.0.0.tar.gz | 73.1 kB | With provenance | Details for pr_merge_audit-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pr_merge_audit-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for pr_merge_audit-2.0.0-py3-none-any.whl |
Total release size: 110.7 kB
Release files / pr_merge_audit-2.0.0.tar.gz
| Download URL | pr_merge_audit-2.0.0.tar.gz |
|---|---|
| Size | 73.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f9bcc0477f76180a1ae4ef2dc173c1ac4195627882e3ea0be87ad4a2f046e645
|
|
BLAKE2b-256 checksum How to use checksums |
8ba2a79aa5c8a1bd7d11141951d9a3a1f2cce06aa17cbea7f3fcea8b80438e57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logRelease files / pr_merge_audit-2.0.0-py3-none-any.whl
| Download URL | pr_merge_audit-2.0.0-py3-none-any.whl |
|---|---|
| Size | 37.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f24aa70211343c6bc64502edab8869923bf3e8461aa6203f6a7393563584d44
|
|
BLAKE2b-256 checksum How to use checksums |
79358ade3ffc2dd3a74d19a0adbae27f051efa49de217821f6acb3e312343279
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logSecurity for pr-merge-audit 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for pr_merge_audit-2.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 21, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.