From 1d2d06a21d96474b89a54a7c68920fc7dc5b2144 Mon Sep 17 00:00:00 2001 From: nishantapatil3 Date: Tue, 7 Mar 2023 09:02:43 -0800 Subject: [PATCH] Include go mod vendor to resolve licensei detection failures --- .github/workflows/ci.yaml | 9 ++++++++- .licensei.toml | 3 ++- Makefile | 4 ++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 920069edf..63ef2e8db 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -66,10 +66,17 @@ jobs: GITHUB_TOKEN: ${{ github.token }} # Note: this is required for licensei auth in steps to avoid rate-limiting. run: ./bin/licensei list + - name: Vendor dependencies to retrieve licenses locally + # Vendor deps before running https://github.com/goph/licensei + # to avoid false-positive when modules github repo could not be determined + run: go mod vendor -o vendor + - name: Check dependency licenses env: GITHUB_TOKEN: ${{ github.token }} # Note: this is required for licensei auth in steps to avoid rate-limiting. - run: make license-check + run: | + make license-check + make vendor-clean - name: Run unit tests, linter, etc. run: make check diff --git a/.licensei.toml b/.licensei.toml index 18a43d1f8..5d91d2230 100644 --- a/.licensei.toml +++ b/.licensei.toml @@ -29,7 +29,8 @@ ignored = [ [header] ignorePaths = [ - "build" + "build", + "vendor" ] ignoreFiles = [ diff --git a/Makefile b/Makefile index fe4b7bb80..aa58cdf2a 100644 --- a/Makefile +++ b/Makefile @@ -62,6 +62,10 @@ license-check: bin/licensei ## Run license check license-cache: bin/licensei ## Generate license cache bin/licensei cache +.PHONY: vendor-clean +vendor-clean: ## Clean vendor cache + rm -rf ${PWD}/vendor + # Run tests .PHONY: test test: install-envtest