...
1---
2name: third_party_check
3on:
4 pull_request:
5 paths:
6 - '**/go.mod'
7
8permissions:
9 contents: read
10
11jobs:
12 changed_gomods:
13 runs-on: ubuntu-latest
14 steps:
15 - uses: actions/checkout@v4
16 with:
17 fetch-depth: 2
18 - uses: actions/setup-go@v5
19 with:
20 go-version: 1.22.x
21 - name: Find modified go.mod files
22 id: modfiles
23 run: |
24 dirs=$(go run ./internal/actions/cmd/changefinder -q -internal --base=HEAD~1 --diff-filter=d --path-filter='*go.mod')
25 if [ -z "$dirs" ]
26 then
27 echo "skip=1" >> "$GITHUB_OUTPUT"
28 echo "No new/modified go.mod files!"
29 else
30 for d in $dirs; do list=${list},\"${d}\"; done
31 echo "mods={\"mods\":[${list#,}]}" >> "$GITHUB_OUTPUT"
32 echo "skip=" >> "$GITHUB_OUTPUT"
33 fi
34 outputs:
35 mods: ${{ steps.modfiles.outputs.mods }}
36 skip: ${{ steps.modfiles.outputs.skip }}
37 check_deps:
38 needs: changed_gomods
39 runs-on: ubuntu-latest
40 if: "!needs.changed_gomods.outputs.skip"
41 continue-on-error: true
42 strategy:
43 matrix: ${{ fromJson(needs.changed_gomods.outputs.mods) }}
44 steps:
45 - uses: actions/checkout@v4
46 - run: go run ./internal/actions/cmd/thirdpartycheck -q -mod ${{ matrix.mods }}/go.mod
View as plain text