Skip to content

Commit

Permalink
Support for dynamic golangci-lint matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
gaby authored Nov 15, 2023
1 parent 2886582 commit adb9923
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,28 @@ on:
- ".github/dependabot.yml"

jobs:
prepare-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Fetch Repository
uses: actions/checkout@v4
- id: set-matrix
run: |
echo "::set-output name=matrix::$(find . -type d -not -path '*/\.*' | jq -R -s -c 'split("\n")[:-1]')"
golangci-lint:
needs: prepare-matrix
runs-on: ubuntu-latest
strategy:
matrix:
directory: ${{fromJson(needs.prepare-matrix.outputs.matrix)}}
steps:
- name: Fetch Repository
uses: actions/checkout@v4
- name: Run golangci-lint
uses: reviewdog/action-golangci-lint@v2
with:
golangci_lint_flags: "--tests=false"
working-directory: ${{ matrix.directory }}

0 comments on commit adb9923

Please sign in to comment.