name: Dependency License Checks on: push: branches: - main - release-* paths: - "go.mod" pull_request: paths: - "go.mod" workflow_dispatch: {} jobs: license-check: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - name: Setup Go uses: actions/setup-go@v3 with: go-version-file: "go.mod" - name: Find the Go Cache id: go run: | echo "::set-output name=build-cache::$(go env GOCACHE)" echo "::set-output name=mod-cache::$(go env GOMODCACHE)" - name: Cache the Go Build Cache uses: actions/cache@v3 with: path: ${{ steps.go.outputs.build-cache }} key: ${{ runner.os }}-build-check-diff-${{ github.sha }}-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-build-check-diff-${{ github.sha }}- - name: Cache Go Dependencies uses: actions/cache@v3 with: path: ${{ steps.go.outputs.mod-cache }} key: ${{ runner.os }}-pkg-${{ github.sha }}-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-pkg-${{ github.sha }}- - name: License Checks run: | go install github.com/google/go-licenses@latest make license.check