Skip to content

CI: Check license headers. #6

CI: Check license headers.

CI: Check license headers. #6

Workflow file for this run

name: licensecheck
on:
push:
branches: [ master ]
paths:
- '.github/workflows/licensecheck.yml'
- '**.go'
pull_request:
branches: [ master ]
paths:
- '.github/workflows/licensecheck.yml'
- '**.go'
permissions:
contents: read
jobs:
golang:
name: golang
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install licensecheck
run: |
sudo apt-get -y update
sudo apt-get -y install licensecheck
- id: licensecheck
name: Check licenses
run: |
$OUTPUT=$(licensecheck *.go */*.go)
echo "$OUTPUT"
echo "output=$OUTPUT" >> "$GITHUB_OUTPUT"
- name: Check for missing licenses
env:
OUTPUT: ${{steps.licensecheck.outputs.output}}
run: |
MISSING=$(echo "$OUTPUT" | grep UNKNOWN || true)
if [ -n "$MISSING" ]; then \
echo "$MISSING"; \
exit 1; \
fi