GitHub Action that backports merged PRs to other branches.
Preserve when making changes:
- Fast — the action runs quickly for end users
- No inputs required — sensible defaults; drop-in usable
- Flexible & configurable — handles different trigger events and contexts; configurable to fit different use cases
- Clear — the action communicates what it did (and what it tried)
Any behavioral change a user didn't explicitly configure is forbidden. This includes action inputs/outputs, the workflow events the action runs on, and assumptions about the environment (e.g. the checked-out git repository).
This action has many users; maintainer burden compounds. When facing tradeoffs, prefer obvious code over clever abstractions, fewer dependencies over more, and changes that don't complicate the release flow. Existing style isn't sacred — when touching code, diverge from the surrounding pattern when it improves maintainability.
- Modern, idiomatic TypeScript
- Two external boundaries:
GithubApi(src/github.ts) andGitApi(src/git.ts) — see TESTING.md package-lock.jsonis authoritative. Don't runnpm installto "fix" things — investigate the root cause
- Run
npm run allbefore declaring a change done (format + build + package + test) - Tests:
npm test(ornpm run test-verbosefor individual names) - Never commit
dist/in a PR — the Publish workflow rebuilds it post-merge; including it breaks backporting (see CI.md) - Merging goes through the Mergify queue (
@mergifyio queue) — don't merge or push tomaindirectly
- CONTRIBUTING.md — build, package, release flow
- TESTING.md — test architecture, where to add tests, E2E
- CI.md — CI workflows, the
dist/rule, Publish concurrency