From 193acb093451c91cfc27f3100a737de9b3701618 Mon Sep 17 00:00:00 2001 From: Theo Gravity Date: Mon, 4 May 2026 02:06:37 -0700 Subject: [PATCH] chore(ci): dogfood the chore(release) skip filter monorel's own `ci/github/README.md` documents a recipe under "Recipes -> Skipping CI on chore(release) commits" telling downstream consumers to put if: github.event_name == 'pull_request' || !startsWith(github.event.head_commit.message, 'chore(release):') on every job that runs `go mod tidy` or otherwise resolves Go module versions. monorel's own CI didn't follow that recipe. Apply the filter to the three jobs in ci.yml that resolve module versions (test, lint, tidy) and to the e2e job in e2e-gitea.yml. The two PR-only jobs in ci.yml (commit-lint, docs-build) already gate on `github.event_name == 'pull_request'`; no change needed. The race the filter prevents doesn't currently bite monorel because it's a single-module repo and the chore(release) commit doesn't bump go.sum entries; the change is purely: - Free CI minutes saved on chore(release) merges (the diff is CHANGELOG + .changeset/*.md deletion + monorel internal version string; nothing that warrants the full test matrix). - Demonstrates the recipe in monorel's own setup as a working reference for downstream consumers. - Forward-compatible if monorel ever grows sub-modules. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/ci.yml | 15 +++++++++++++++ .github/workflows/e2e-gitea.yml | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd33248..6a635c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,20 @@ permissions: contents: read jobs: + # Skip on `chore(release):` push commits across every job that + # resolves Go module versions (`test`, `lint`, `tidy`). PR runs + # are unaffected because the filter checks `head_commit.message` + # which is null for `pull_request` events. + # + # The dogfood: monorel's own `ci/github/README.md` documents this + # recipe (Recipes -> "Skipping CI on chore(release) commits") for + # downstream consumers; this workflow demonstrates it in monorel's + # own setup. Today monorel is single-module so the chore(release) + # commit doesn't add new versions to its go.sum and the race the + # filter prevents wouldn't bite. Forward-compatible if monorel + # ever grows sub-modules. test: + if: github.event_name == 'pull_request' || !startsWith(github.event.head_commit.message, 'chore(release):') runs-on: ubuntu-latest strategy: matrix: @@ -26,6 +39,7 @@ jobs: - run: go test -race -count=1 ./... lint: + if: github.event_name == 'pull_request' || !startsWith(github.event.head_commit.message, 'chore(release):') runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -44,6 +58,7 @@ jobs: - run: staticcheck ./... tidy: + if: github.event_name == 'pull_request' || !startsWith(github.event.head_commit.message, 'chore(release):') runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/e2e-gitea.yml b/.github/workflows/e2e-gitea.yml index d94f071..6ce417c 100644 --- a/.github/workflows/e2e-gitea.yml +++ b/.github/workflows/e2e-gitea.yml @@ -40,6 +40,12 @@ permissions: jobs: e2e: + # Skip on chore(release) push commits. The e2e suite spins up a + # Forgejo container and exercises monorel against an ephemeral + # repo inside it; nothing about the chore(release) merge changes + # the suite's behavior, so re-running it on the release commit + # just burns CI minutes. + if: github.event_name != 'push' || !startsWith(github.event.head_commit.message, 'chore(release):') runs-on: ubuntu-latest timeout-minutes: 20 steps: