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