From aba488abf87c4f0bacf6e53fd588e5c644c1f56a Mon Sep 17 00:00:00 2001 From: Thomas Kosiewski Date: Mon, 9 Feb 2026 13:24:15 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20ci:=20gate=20CI=20jobs=20by=20ch?= =?UTF-8?q?anged=20paths?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a changes-classifier job using dorny/paths-filter and gate lint/test/lint-actions by relevant file changes. Update publish-main to tolerate intentionally skipped dependencies while still requiring success when jobs do run. --- _Generated with [`mux`](https://github.com/coder/mux) • Model: `openai:gpt-5.3-codex` • Thinking: `xhigh` • Cost: `$0.16`_ --- .github/workflows/ci.yaml | 56 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 672e9368..6b7179c6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,7 +10,48 @@ permissions: contents: read jobs: + changes: + name: Detect changed paths + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + outputs: + go: ${{ steps.filter.outputs.go }} + workflows: ${{ steps.filter.outputs.workflows }} + publish: ${{ steps.filter.outputs.publish }} + steps: + - name: Checkout + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false + + - name: Detect changed paths + id: filter + uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 + with: + filters: | + go: + - '**/*.go' + - 'go.mod' + - 'go.sum' + - 'vendor/**' + - 'Makefile' + - '.golangci.yml' + - '.golangci.yaml' + workflows: + - '.github/workflows/**' + publish: + - '**/*.go' + - 'go.mod' + - 'go.sum' + - 'vendor/**' + - 'Dockerfile*' + - 'Dockerfile.goreleaser' + lint: + needs: changes + if: needs.changes.outputs.go == 'true' runs-on: ubuntu-latest steps: - name: Checkout @@ -46,6 +87,8 @@ jobs: go-package: ./... test: + needs: changes + if: needs.changes.outputs.go == 'true' runs-on: ubuntu-latest steps: - name: Checkout @@ -77,6 +120,8 @@ jobs: lint-actions: name: Lint GitHub Actions + needs: changes + if: needs.changes.outputs.workflows == 'true' runs-on: ubuntu-latest permissions: contents: read @@ -122,8 +167,15 @@ jobs: publish-main: name: Publish GHCR :main - needs: [test, lint, lint-actions] - if: github.event_name == 'push' && github.ref == 'refs/heads/main' + needs: [changes, test, lint, lint-actions] + if: | + always() && + github.event_name == 'push' && + github.ref == 'refs/heads/main' && + needs.changes.outputs.publish == 'true' && + (needs.test.result == 'success' || needs.test.result == 'skipped') && + (needs.lint.result == 'success' || needs.lint.result == 'skipped') && + (needs.lint-actions.result == 'success' || needs.lint-actions.result == 'skipped') runs-on: ubuntu-latest permissions: contents: read