Separate Modules + Lint MultiNode #15
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Golangci-lint | |
on: [pull_request] | |
jobs: | |
golangci-lint: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
actions: read | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.19' | |
- name: Find Go modules | |
id: find-modules | |
run: | | |
modules=$(go list -m -json all | jq -r '.Dir') | |
echo "modules=$modules" >> $GITHUB_ENV | |
- name: Run golangci-lint for each module | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: v1.62.2 | |
args: | | |
for module in ${{ env.modules }}; do | |
echo "Running golangci-lint in $module" | |
cd $module | |
golangci-lint run || exit 1 | |
cd - | |
done |