Skip to content

Commit

Permalink
ci: Run lint only if code or lint rules or ci actions have changed
Browse files Browse the repository at this point in the history
  • Loading branch information
sonjek committed Apr 8, 2024
1 parent cf99165 commit ceb4438
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/files-changed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand All @@ -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
Expand All @@ -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"

0 comments on commit ceb4438

Please sign in to comment.