Update check-metadata.yml

This commit is contained in:
Kristo Copani 2024-12-29 23:49:31 +02:00 committed by GitHub
parent 2aa1496540
commit d22b43c68a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,30 +17,33 @@ jobs:
FILES=$(find . -name "*.sh")
for FILE in $FILES; do
if grep -qF "# Copyright (c) 2021-2024 community-scripts ORG" "$FILE"; then
echo "Check for Copyright metadata passed for: $FILE"
else
echo "Error in $FILE: Copyright metadata missing"
ERROR_COUNT=$((ERROR_COUNT + 1))
fi
if grep -qF "# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE" "$FILE"; then
echo "Check for License metadata passed for: $FILE"
else
echo "Error in $FILE: License metadata missing"
ERROR_COUNT=$((ERROR_COUNT + 1))
fi
if grep -q "^# Source: .\+" "$FILE"; then
echo "Check for Source metadata passed for: $FILE"
else
echo "Error in $FILE: Source metadata missing"
ERROR_COUNT=$((ERROR_COUNT + 1))
fi
if grep -q "^# Source: .\+" "$FILE"; then
echo "Check for Author metadata passed for: $FILE"
else
echo "Error in $FILE: Author metadata missing"
ERROR_COUNT=$((ERROR_COUNT + 1))
fi
if [[ "$(sed -n '3p' "$FILE")" == "# Copyright (c) 2021-2024 community-scripts ORG" ]]; then
echo "Check for Copyright metadata passed for line 3 in: $FILE"
else
echo "Error in $FILE: Copyright metadata missing or not on line 3"
ERROR_COUNT=$((ERROR_COUNT + 1))
fi
if sed -n '4p' "$FILE" | grep -qE "^# Author: .+"; then
echo "Check for Author metadata passed for line 4 in: $FILE"
else
echo "Error in $FILE: Author metadata missing or invalid on line 4"
ERROR_COUNT=$((ERROR_COUNT + 1))
fi
if [[ "$(sed -n '5p' "$FILE")" == "# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE" ]]; then
echo "Check for License metadata passed for line 5 in: $FILE"
else
echo "Error in $FILE: License metadata missing or not on line 5"
ERROR_COUNT=$((ERROR_COUNT + 1))
fi
if sed -n '6p' "$FILE" | grep -qE "^# Source: .+"; then
echo "Check for Source metadata passed for line 6 in: $FILE"
else
echo "Error in $FILE: Source metadata missing or invalid on line 6"
ERROR_COUNT=$((ERROR_COUNT + 1))
fi
done
if [[ "$ERROR_COUNT" -gt 0 ]]; then