File tree Expand file tree Collapse file tree 1 file changed +12
-21
lines changed
Expand file tree Collapse file tree 1 file changed +12
-21
lines changed Original file line number Diff line number Diff line change @@ -21,28 +21,19 @@ jobs:
2121 - name : Find Go modules
2222 id : find-modules
2323 run : |
24- # Find all directories containing a go.mod file and save them as a newline-separated list
25- find . -name "go.mod" -exec dirname {} \; > go_modules.txt
26- echo "modules=$(cat go_modules.txt | tr '\n' ' ')" >> $GITHUB_OUTPUT
24+ modules=$(go list -m -json all | jq -r '.Dir')
25+ echo "modules=$modules" >> $GITHUB_ENV
2726
2827 - name : Run golangci-lint for each module
29- run : |
30- failed_modules=""
31- for module in ${{ steps.find-modules.outputs.modules }}; do
32- echo "Running golangci-lint in $module"
33- cd $module
34-
35- if ! golangci-lint run; then
36- failed_modules="$failed_modules $module"
37- fi
28+ uses : golangci/golangci-lint-action@v3
29+ with :
30+ version : v1.62.2
31+ args : |
32+ for module in ${{ env.modules }}; do
33+ echo "Running golangci-lint in $module"
34+ cd $module
3835
39- cd -
40- done
36+ golangci-lint run || exit 1
4137
42- if [ -n "$failed_modules" ]; then
43- echo "The following modules failed linting:"
44- echo "$failed_modules"
45- exit 1
46- else
47- echo "All modules passed linting."
48- fi
38+ cd -
39+ done
You can’t perform that action at this time.
0 commit comments