Files
AppleCommander/.github/workflows/license.yml
2025-08-26 11:06:35 -05:00

37 lines
910 B
YAML

# This is a crude license header check. The ones I tested were susceptible to whitespace differences
# and I never got them to work. My primary goal is to ensure the headers exist, so this suffices.
name: Verify AppleCommander has a license header
on:
push:
branches: [ "main" ]
tags:
- '*'
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Look for license phrase
run: |
outfile=$(mktemp)
find . -name "*.java" -not -name "Sleak.java" | xargs grep -L "GNU General Public License" > ${outfile}
if [ -s "${outfile}" ]
then
echo "License headers missing on the following files:"
cat ${outfile}
exit 1
else
echo "License headers appear to be valid!"
fi