A GitHub repo template for shipping to production safely.
Move fast — but don't break prod.
A ready-to-use repository template with branch protection rules, a CI workflow, a PR template, and documentation. It gives small teams a production-safe workflow in under 30 minutes — no paid tools, no complex setup.
- Solo developers who want guardrails without overhead
- Small teams (2-10 people) setting up a new repo
- Anyone tired of pushing directly to
mainand hoping for the best
| File | Purpose |
|---|---|
.github/pull_request_template.md |
PR template with summary, risk level, testing, and rollback sections |
.github/workflows/ci.yml |
Minimal CI workflow that runs on PRs to dev and main |
.github/workflows/stale.yml |
Marks issues and PRs stale after 60 days without activity and closes them 14 days later |
.github/dependabot.yml |
Weekly Dependabot updates for the pinned GitHub Actions |
.github/CODEOWNERS |
Requests review from the owner on every PR. Replace @JosephDoUrden with your own user or team |
.github/ISSUE_TEMPLATE/ |
Bug report and feature request templates |
docs/branch-protection.md |
Step-by-step guide to protecting main and dev in GitHub |
docs/verified-commits.md |
How to set up SSH or GPG commit signing |
docs/dev-to-main-flow.md |
The branching workflow, merge strategies, and hotfix process |
examples/ruleset-main.json |
Ruleset for main, ready to import |
examples/ruleset-dev.json |
Ruleset for dev, ready to import |
CONTRIBUTING.md |
How to open issues and pull requests, plus the docs writing style |
CODE_OF_CONDUCT.md |
Contributor Covenant 2.1 |
SECURITY.md |
How to report a vulnerability privately |
flowchart LR
F["feature/* or fix/*"] -->|"PR, squash merge"| D[dev]
D -->|"PR, merge commit"| M[main]
M -->|deploy| P[production]
H["fix/* hotfix"] -->|PR| M
M -.->|merge back| D
Every arrow into dev or main is a pull request that needs the Lint & Test check to pass. Nobody pushes to main directly, admins included. docs/dev-to-main-flow.md has the details.
-
Use this template. Click "Use this template" on GitHub to create your repo.
-
Set up branch protection. Import the rulesets (see below) or follow docs/branch-protection.md to protect
mainanddevby hand. -
Configure commit signing. Follow docs/verified-commits.md to sign your commits with SSH or GPG.
-
Customize CI. Open
.github/workflows/ci.ymland replace the placeholderechocommands with your actual lint and test commands. -
Start shipping. Read docs/dev-to-main-flow.md for the day-to-day workflow, then open your first PR.
The examples/ folder holds ruleset exports for main and dev. Import them in Settings > Rules > Rulesets > New ruleset > Import a ruleset, or from the command line:
gh api --method POST repos/OWNER/REPO/rulesets --input examples/ruleset-main.json
gh api --method POST repos/OWNER/REPO/rulesets --input examples/ruleset-dev.jsondocs/branch-protection.md explains what each file enforces and what to change first.
Safety should be the default, not an afterthought. This template makes "the right way" the easy way: all changes go through a pull request, CI runs automatically, and main always reflects what's in production. It's strict enough to prevent mistakes but light enough that it doesn't slow you down.
Isn't this overkill for a solo developer?
No. Branch protection isn't about code review — it's about making deploys intentional. A PR gives you a moment to read your own diff, confirm CI passes, and merge deliberately instead of pushing on impulse.
Can I skip the dev branch?
You can, but it's not recommended. The dev branch lets you batch features and test them together before promoting to production. If you skip it, you lose that staging layer. See docs/dev-to-main-flow.md for the full rationale.
What if I don't want signed commits?
Commit signing is recommended but not required. If you skip it, just don't enable "Require signed commits" in your branch protection rules. Everything else still works.
Contributions are welcome. Read CONTRIBUTING.md before opening a pull request, and report security problems through SECURITY.md.
If you use this template, update the contact details in CODE_OF_CONDUCT.md and SECURITY.md for your own project.