Skip to content

Commit cabd031

Browse files
dwoodruff83claude
andcommitted
Add branch protection workflow and CONTRIBUTING.md
The workflow gates PRs into main: only PRs from the 'staging' branch pass the check. Combined with branch protection's "require status checks to pass" rule (set in the GitHub UI), the merge button on main PRs from any branch other than staging will be disabled. CONTRIBUTING.md documents the branch flow (feature/* -> staging -> main), local setup, and the existing standard-library / Python 3.11+ conventions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 43fe612 commit cabd031

2 files changed

Lines changed: 73 additions & 0 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Enforce main PRs from staging only
2+
3+
# Fails any pull request that targets `main` from a source branch other than
4+
# `staging`. Combined with branch protection's "Require status checks to pass
5+
# before merging" rule, this gates the merge button on the GitHub UI.
6+
#
7+
# Branch flow:
8+
# feature/* -> PR into staging -> (review) -> staging -> PR into main
9+
10+
on:
11+
pull_request:
12+
branches: [main]
13+
14+
jobs:
15+
check-source-branch:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Verify source is staging
19+
run: |
20+
if [ "${{ github.head_ref }}" != "staging" ]; then
21+
echo "::error::PRs to main must come from the 'staging' branch only. Got: '${{ github.head_ref }}'"
22+
exit 1
23+
fi
24+
echo "PR source is 'staging' — OK"

CONTRIBUTING.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Contributing
2+
3+
Thanks for considering a contribution. The codebase is intentionally small and dependency-free; please keep it that way.
4+
5+
## Branch flow
6+
7+
```
8+
feature/<short-name> work branches
9+
|
10+
v
11+
staging integration branch (where everything lands first)
12+
|
13+
v
14+
main stable, public-facing, only updated via PR from staging
15+
```
16+
17+
- Open all PRs against **`staging`** by default
18+
- `main` is protected. PRs into `main` are only accepted from `staging` (enforced by `.github/workflows/enforce-main-source.yml` and branch protection rules)
19+
- Force pushes and branch deletions are disabled on both `main` and `staging`
20+
21+
This keeps `main` always-shippable and gives `staging` room to integrate multiple feature branches before promoting.
22+
23+
## Local setup
24+
25+
1. Fork or clone the repo
26+
2. Create a feature branch off `staging`: `git checkout -b feature/my-thing staging`
27+
3. Make changes, commit, push the feature branch, open a PR into `staging`
28+
29+
## Code conventions
30+
31+
- **Standard library only.** No `pip` dependencies, no `requirements.txt`, no `pyproject.toml`. If a feature needs more, propose an alternative or open an issue first.
32+
- **Python 3.11+** is the floor (for `tomllib`).
33+
- **Plain technical voice** in code, comments, docs, and commits.
34+
- Cross-platform: avoid OS-specific paths in code; the user's `mod_tracker.toml` is the anchor.
35+
- Output to stdout should be UTF-8 even on Windows. User-facing scripts re-wrap `sys.stdout`/`sys.stderr` at module load if the encoding isn't UTF-8.
36+
37+
## Tests
38+
39+
There's no test suite by design — the codebase is mostly pipelines that compose around git and a small TOML config. The smoke check is "run the eight scripts against a populated workspace and verify they all complete without errors." See `CLAUDE.md` in the repo root for the full smoke test recipe.
40+
41+
## Reporting issues
42+
43+
Open an issue with:
44+
- What you ran (exact command line)
45+
- What you expected to happen
46+
- What actually happened (stack trace, error message, or unexpected output)
47+
- Your OS, Python version, and Git version
48+
49+
For game-developer takedown requests: see the **Legal and ethical use** section in the README. Open an issue and the maintainer will work with you.

0 commit comments

Comments
 (0)