mirror of
https://github.com/lunchcat/sif.git
synced 2026-06-12 19:11:25 -07:00
648fa8d2c8
rolls the (c) 2022-2025 banner to 2022-2026 across all go files, the startup banner in sif.go, and the header-check workflow's expected format. comment-only, nothing else changes.
56 lines
2.3 KiB
YAML
56 lines
2.3 KiB
YAML
name: header check
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- '**.go'
|
|
pull_request:
|
|
paths:
|
|
- '**.go'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
check-headers:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: check license headers
|
|
run: |
|
|
missing_headers=()
|
|
|
|
while IFS= read -r -d '' file; do
|
|
# skip test files and generated files
|
|
if [[ "$file" == *"_test.go" ]]; then
|
|
continue
|
|
fi
|
|
|
|
# check if file starts with the license header (signature is on line 4)
|
|
if ! head -n 5 "$file" | grep -q "█▀ █ █▀▀"; then
|
|
missing_headers+=("$file")
|
|
fi
|
|
done < <(find . -name "*.go" -type f -print0)
|
|
|
|
if [ ${#missing_headers[@]} -ne 0 ]; then
|
|
echo "::error::the following files are missing the license header:"
|
|
printf '%s\n' "${missing_headers[@]}"
|
|
echo ""
|
|
echo "expected header format:"
|
|
echo '/*'
|
|
echo '·━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━·'
|
|
echo ': :'
|
|
echo ': █▀ █ █▀▀ · Blazing-fast pentesting suite :'
|
|
echo ': ▄█ █ █▀ · BSD 3-Clause License :'
|
|
echo ': :'
|
|
echo ': (c) 2022-2026 vmfunc, xyzeva, :'
|
|
echo ': lunchcat alumni & contributors :'
|
|
echo ': :'
|
|
echo '·━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━·'
|
|
echo '*/'
|
|
exit 1
|
|
fi
|
|
|
|
echo "all go files have proper license headers"
|