diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml index 0641e95ce..9914b9000 100644 --- a/.github/workflows/build-images.yaml +++ b/.github/workflows/build-images.yaml @@ -17,7 +17,33 @@ concurrency: cancel-in-progress: true jobs: + # Docs-only changes (docs/, markdown, rst) can't affect the built image, so building/pushing one + # is redundant. Detected once here so the job below can skip entirely on them. + changes: + runs-on: ubuntu-latest + outputs: + code: ${{ steps.filter.outputs.code }} + steps: + - name: Checkout + uses: actions/checkout@v7 + with: + fetch-depth: 0 + + - name: Check for non-doc changes + id: filter + uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 + with: + predicate-quantifier: 'some-with-excludes' + filters: | + code: + - '**' + - '!docs/**' + - '!**/*.md' + - '!**/*.rst' + docker: + needs: changes + if: needs.changes.outputs.code == 'true' runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 7f31c63d0..ab7b8ff11 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -23,8 +23,34 @@ on: - 'V*' jobs: + # Docs-only changes (docs/, markdown, rst) can't affect Go code, so CodeQL has nothing new to + # find. Detected once here so the job below can skip entirely on them. + changes: + runs-on: ubuntu-latest + outputs: + code: ${{ steps.filter.outputs.code }} + steps: + - name: Checkout + uses: actions/checkout@v7 + with: + fetch-depth: 0 + + - name: Check for non-doc changes + id: filter + uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 + with: + predicate-quantifier: 'some-with-excludes' + filters: | + code: + - '**' + - '!docs/**' + - '!**/*.md' + - '!**/*.rst' + analyze: name: Analyze + needs: changes + if: needs.changes.outputs.code == 'true' runs-on: ubuntu-latest permissions: actions: read diff --git a/.github/workflows/govulncheck.yaml b/.github/workflows/govulncheck.yaml index e926ff7a1..62eade10a 100644 --- a/.github/workflows/govulncheck.yaml +++ b/.github/workflows/govulncheck.yaml @@ -16,7 +16,33 @@ on: - 'V*' jobs: + # Docs-only changes (docs/, markdown, rst) can't affect Go code, so govulncheck has nothing new + # to find. Detected once here so the job below can skip entirely on them. + changes: + runs-on: ubuntu-latest + outputs: + code: ${{ steps.filter.outputs.code }} + steps: + - name: Checkout + uses: actions/checkout@v7 + with: + fetch-depth: 0 + + - name: Check for non-doc changes + id: filter + uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3 + with: + predicate-quantifier: 'some-with-excludes' + filters: | + code: + - '**' + - '!docs/**' + - '!**/*.md' + - '!**/*.rst' + govulncheck_job: + needs: changes + if: needs.changes.outputs.code == 'true' runs-on: ubuntu-latest name: Run govulncheck steps: @@ -24,4 +50,4 @@ jobs: uses: golang/govulncheck-action@v1 with: go-version-input: 'stable' - go-package: ./... \ No newline at end of file + go-package: ./...