From f95d61279d9f1edae188b904895a4bfd87aca113 Mon Sep 17 00:00:00 2001 From: Jensen Bernard Date: Fri, 27 Mar 2026 14:09:00 +0100 Subject: [PATCH] feat: add CI check to enforce version bump on every PR Adds a GitHub Actions workflow that fails PRs targeting main if the VERSION file was not modified. This prevents merging without a version bump. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/version-check.yml | 25 +++++++++++++++++++++++++ TODOS.md | 9 +++++++++ VERSION | 2 +- 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/version-check.yml create mode 100644 TODOS.md diff --git a/.github/workflows/version-check.yml b/.github/workflows/version-check.yml new file mode 100644 index 0000000..e75894e --- /dev/null +++ b/.github/workflows/version-check.yml @@ -0,0 +1,25 @@ +name: version-check + +on: + pull_request: + branches: [main] + +jobs: + version-bump: + name: Version Bump Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check VERSION was bumped + run: | + if git diff origin/main...HEAD --quiet -- VERSION; then + echo "::error::VERSION file was not changed. Please bump the version before merging." + echo "" + echo "Update the VERSION file with the new version number." + echo "See https://semver.org for versioning guidance." + exit 1 + fi + echo "VERSION was bumped. ✓" diff --git a/TODOS.md b/TODOS.md new file mode 100644 index 0000000..681db72 --- /dev/null +++ b/TODOS.md @@ -0,0 +1,9 @@ +# TODOs + +## Mark `version-check` as required in GitHub branch protection + +**Why:** The CI check runs on every PR but doesn't block merging until it's marked as a required status check. Without this, developers can still merge PRs that skip the version bump. + +**How:** After the version-check workflow PR is merged, go to GitHub → Settings → Branches → Branch protection rules → main → Require status checks to pass → add `Version Bump Check`. + +**Added:** 2026-03-27 diff --git a/VERSION b/VERSION index 7dea76e..6d7de6e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.1 +1.0.2