Skip to content

Commit

Permalink
Merge pull request #53 from authzed/license-check
Browse files Browse the repository at this point in the history
Add go-licenses check action
  • Loading branch information
josephschorr committed Apr 1, 2024
2 parents 89564af + 057a521 commit 5659d22
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions go-license-check/action.yaml
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 ./..."

0 comments on commit 5659d22

Please sign in to comment.