From 0aa15aaaa1c51c584a52fd02c758ae13e034af5a Mon Sep 17 00:00:00 2001 From: Theo Gravity Date: Sun, 3 May 2026 00:04:17 -0700 Subject: [PATCH] fix(ci): skip CI on chore(release): commits to avoid tag-push race The chore(release): merge commit updates every released module's go.mod to require a new go.loglayer.dev version (e.g. v2.1.0). The matching tag is created concurrently by release.yml on the same push. ci.yml's `Verify modules tidy` step races with that tag push and loses, producing a phantom CI failure on every release: go: go.loglayer.dev/transports/cli/v2 imports go.loglayer.dev/v2: reading go.loglayer.dev/go.mod at revision v2.1.0: unknown revision v2.1.0 Meanwhile release.yml on the same commit succeeds and the tags get pushed. The CI red-mark is misleading: the project is fine, it's just a workflow-ordering bug. Mirror the skip pattern release-pr.yml already uses: when the head commit subject starts with chore(release): on a push to main, skip the whole CI matrix. Pull-request runs are unaffected (the if-clause keeps PR triggers always-on). Filed upstream as https://github.com/disaresta-org/monorel/issues/54 (comment on the existing thread); the recipe should be in monorel's docs so other adopters don't hit the same flake. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a71cbd9..04c5b99 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,14 @@ concurrency: cancel-in-progress: true jobs: + # The chore(release): merge commit updates each released module's + # go.mod to require a new go.loglayer.dev version. The matching tag + # is created concurrently by release.yml on the same push. Tidy here + # races with that tag push and loses; skip the run so the release + # workflow has the field to itself. The next non-release push to main + # triggers a clean CI. test: + if: github.event_name == 'pull_request' || !startsWith(github.event.head_commit.message, 'chore(release):') name: Test (Go ${{ matrix.go }}) runs-on: ubuntu-latest strategy: @@ -79,6 +86,7 @@ jobs: run: go build -o /dev/null ./... staticcheck: + if: github.event_name == 'pull_request' || !startsWith(github.event.head_commit.message, 'chore(release):') name: Staticcheck runs-on: ubuntu-latest env: @@ -119,6 +127,7 @@ jobs: run: scripts/foreach-module.sh staticcheck govulncheck: + if: github.event_name == 'pull_request' || !startsWith(github.event.head_commit.message, 'chore(release):') name: Govulncheck runs-on: ubuntu-latest env: