Files
dependabot[bot] aaa718bdf6 Bump actions/checkout from 6 to 7 in /.github/workflows in the gh-dependency group across 1 directory (#3530)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-19 17:08:11 +02:00

38 lines
1001 B
YAML

# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0
name: Check License Header
on:
pull_request:
branches:
- main
jobs:
check-license:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Check License Header
run: |
CHECK=""
for file in $(grep -rl --exclude-dir={.git,build} \
--exclude=\*.{crt,key,pem,zed,hcl,md,json,csv,mod,sum,tmpl,args} \
--exclude={CODEOWNERS,LICENSE,MAINTAINERS,enabled_plugins,rabbitmq.conf} \
.); do
if ! head -n 5 "$file" | grep -q "Copyright (c) Abstract Machines"; then
CHECK="$CHECK $file"
fi
done
if [ "$CHECK" ]; then
echo "License header check failed. Fix the following files:"
echo "$CHECK"
exit 1
else
echo "All files have the correct license header!"
fi