Skip to content

Commit

Permalink
CI: Check license headers of Go files.
Browse files Browse the repository at this point in the history
  • Loading branch information
fancycode committed Dec 21, 2023
1 parent 110ece7 commit 682d3aa
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/licensecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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: |
{
echo 'CHECK_RESULT<<EOF'
licensecheck *.go */*.go
echo EOF
} >> "$GITHUB_ENV"
- name: Check for missing licenses
run: |
MISSING=$(echo "$CHECK_RESULT" | grep UNKNOWN || true)
if [ -n "$MISSING" ]; then \
echo "$MISSING"; \
exit 1; \
fi

0 comments on commit 682d3aa

Please sign in to comment.