From ceb4438afdb4172d044f6cd9610bed683263c43b Mon Sep 17 00:00:00 2001 From: Yevhen Pavlov Date: Mon, 8 Apr 2024 21:14:26 +0300 Subject: [PATCH] ci: Run lint only if code or lint rules or ci actions have changed --- .github/workflows/ci.yml | 2 +- .github/workflows/files-changed.yml | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 35bd07e..e6443f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: uses: ./.github/workflows/files-changed.yml lint: - if: needs.files-changed.outputs.app == 'true' || needs.files-changed.outputs.actions == 'true' + if: needs.files-changed.outputs.lint == 'true' || needs.files-changed.outputs.actions == 'true' needs: files-changed runs-on: macos-latest steps: diff --git a/.github/workflows/files-changed.yml b/.github/workflows/files-changed.yml index b23c8a4..6d0ca86 100644 --- a/.github/workflows/files-changed.yml +++ b/.github/workflows/files-changed.yml @@ -7,6 +7,8 @@ on: value: ${{ jobs.detect.outputs.app }} actions: value: ${{ jobs.detect.outputs.actions }} + lint: + value: ${{ jobs.detect.outputs.lint }} docs: value: ${{ jobs.detect.outputs.docs }} @@ -17,6 +19,7 @@ jobs: outputs: app: ${{ steps.changes.outputs.app }} actions: ${{ steps.changes.outputs.actions }} + lint: ${{ steps.changes.outputs.lint }} docs: ${{ steps.changes.outputs.docs }} steps: - uses: actions/checkout@v4 @@ -32,12 +35,16 @@ jobs: - "go.mod" - "go.sum" - "Makefile" - - ".golangci.yml" actions: - added|modified: - ".github/workflows/*" - "Makefile" + lint: + - added|modified: + - "**/*.go" + - ".golangci.yml" + docs: - "**/*.md"