-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from authzed/license-check
Add go-licenses check action
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
name: "Go - Licenses Check" | ||
description: | | ||
This action runs `go-licenses check` over the working tree to verify that | ||
there are no disallowed licenses used by imported packages. | ||
See: https://github.com/google/go-licenses?tab=readme-ov-file#checking-for-forbidden-licenses | ||
inputs: | ||
version: | ||
description: "The version of go-licenses used if it is not already installed." | ||
default: "latest" | ||
required: false | ||
working_directory: | ||
description: "The directory with the root of the project" | ||
default: "." | ||
required: false | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "Install Go Licenses" | ||
id: "golicenses-install" | ||
shell: "bash" | ||
working-directory: "${{ inputs.working_directory }}" | ||
run: | | ||
if which go-licenses > /dev/null; then | ||
echo "found existing go-licenses installed" | ||
else | ||
go install github.com/google/go-licenses@${{ inputs.version }} | ||
fi | ||
- name: "Run Go Licenses Check" | ||
shell: "bash" | ||
working-directory: "${{ inputs.working_directory }}" | ||
run: "go-licenses check --include_tests ./..." |