From 11e8a8127d6038ff4479866673ff47bcf11554d9 Mon Sep 17 00:00:00 2001 From: Andy Feller Date: Fri, 20 Jun 2025 16:53:11 -0400 Subject: [PATCH] Use `make` for license generation and checks --- .github/workflows/lint.yml | 2 +- Makefile | 8 ++++++++ docs/license-compliance.md | 10 ++-------- script/licenses-check | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a855a443f..942f43071 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -58,4 +58,4 @@ jobs: run: | export GOROOT=$(go env GOROOT) export PATH=${GOROOT}/bin:$PATH - ./script/licenses-check + make licenses-check diff --git a/Makefile b/Makefile index 32a06df2f..f823f6e93 100644 --- a/Makefile +++ b/Makefile @@ -106,3 +106,11 @@ ifndef VERSION endif ./script/release --local "$(VERSION)" --platform macos ./script/pkgmacos $(VERSION) + +.PHONY: licenses +licenses: + ./script/licenses + +.PHONY: licenses-check +licenses-check: + ./script/licenses-check diff --git a/docs/license-compliance.md b/docs/license-compliance.md index 238ab9aa0..69099cdd2 100644 --- a/docs/license-compliance.md +++ b/docs/license-compliance.md @@ -25,7 +25,7 @@ When dependencies change, you need to update the license information: 1. Update license information for all platforms: ```shell - script/licenses + make licenses ``` 2. Commit the changes: @@ -40,13 +40,7 @@ When dependencies change, you need to update the license information: The CI workflow checks if license information is up to date. To check locally: ```sh -script/licenses-check +make licenses-check ``` If the check fails, follow the instructions to update the license information. - -## How It Works - -- `script/licenses` - Script to generate license information for all platforms or a specific platform -- `script/licenses-check` - Script to check if license information is up to date -- `.github/workflows/lint.yml` - CI workflow that includes license compliance checking diff --git a/script/licenses-check b/script/licenses-check index 07f9dae8d..345a964ac 100755 --- a/script/licenses-check +++ b/script/licenses-check @@ -15,7 +15,7 @@ for goos in linux darwin windows ; do echo "Checking licenses for ${goos}..." GOOS="${goos}" go-licenses report ./... --template .github/licenses.tmpl --ignore github.com/cli/cli > "${TEMPDIR}/third-party-licenses.${goos}.md" || echo "Ignore warnings" if ! diff -s "${TEMPDIR}/third-party-licenses.${goos}.md" "third-party-licenses.${goos}.md"; then - echo "::error title=License check failed::Please update the license files by running \`script/licenses\` and committing the output." + echo "::error title=License check failed::Please update the license files by running \`make licenses\` and committing the output." exit 1 fi done