diff --git a/.github/workflows/main-pr-source.yml b/.github/workflows/main-pr-source.yml new file mode 100644 index 0000000..b79936e --- /dev/null +++ b/.github/workflows/main-pr-source.yml @@ -0,0 +1,27 @@ +# Enforces the branch rule: main is only updated by a pull request from +# develop. The main ruleset requires this check, so a PR into main from any +# other branch (or from a fork) cannot be merged. +name: Main PR source + +on: + pull_request: + branches: [main] + +permissions: {} + +jobs: + check-source: + name: PR source is develop + runs-on: ubuntu-latest + steps: + - name: Require develop as the source branch + env: + HEAD_REF: ${{ github.head_ref }} + HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }} + BASE_REPO: ${{ github.repository }} + run: | + if [ "$HEAD_REF" != "develop" ] || [ "$HEAD_REPO" != "$BASE_REPO" ]; then + echo "::error::main only accepts pull requests from develop in this repository (got $HEAD_REPO:$HEAD_REF)." + exit 1 + fi + echo "Source is develop. OK." diff --git a/.gitignore b/.gitignore index 1e50c49..dd435eb 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,10 @@ docs/vendor/ .DS_Store Thumbs.db *.swp + +# Python bytecode and virtual environments from tools/ +__pycache__/ +*.pyc +.venv/ +venv/ + diff --git a/CLAUDE.md b/CLAUDE.md index c5026b9..55545d4 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -9,7 +9,7 @@ built spec-first with GitHub Spec Kit (`/speckit-specify`, `/speckit-plan`, | App (menu name) | Script | Spec | Based on | | --- | --- | --- | --- | -| Speed Gauge | `src/Apps/AG-SpdGa.lua` (planned) | `specs/001-speed-gauge/` | DFM Speed Announcer (Dave McQueeney, MIT) | +| Speed Gauge | `src/Apps/AG-SpdGa.lua` | `specs/001-speed-gauge/` | DFM Speed Announcer (Dave McQueeney, MIT) | Keep this table current when an app is added. @@ -76,6 +76,22 @@ src/Apps/lib/ag_xxxxx.lua shared module, loaded with require("ag_xxxxx") - `loop()` runs every 20-30 ms: rate-limit with `system.getTimeCounter()`, and don't format strings or build tables per call. +## Branches + +- `main` is updated **only** by a pull request from `develop`. Never commit + or push to `main` directly, and never open a PR into `main` from any other + branch. GitHub enforces this (a ruleset on `main` plus the + `PR source is develop` check in `.github/workflows/main-pr-source.yml`). +- Feature work goes on `feature/NNN-name`, branched from `develop`, with the + same `NNN-name` as the spec folder, and is merged back into `develop` by + pull request. Never commit directly to `develop` either. +- When `develop` is ready to release, open a PR from `develop` into `main`. + After it merges, tag the release `