Skip to content

Commit

Permalink
Better copyright workflow: exclude some extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
fballiano committed Nov 24, 2024
1 parent 3b60d30 commit ad38fb5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/copyright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,20 @@ jobs:
continue
fi
# Skip CSV, SVG files and known binary extensions
extension="${file##*.}"
if [[ "${extension,,}" =~ ^(csv|svg|png|jpg|jpeg|gif|ico)$ ]]; then
echo "ℹ️ Skipping $file (excluded file type)"
continue
fi
# Check if file contains the copyright string with current year
# Pattern matches either:
# @copyright Copyright (c) 2024 Maho (https://mahocommerce.com)
# @copyright Copyright (c) (2024-)2024 Maho (https://mahocommerce.com)
if ! grep -E -q "Copyright \(c\) (\(2024-\))?${CURRENT_YEAR} Maho \(https://mahocommerce\.com\)" "$file"; then
echo "❌ Copyright notice missing in: $file"
ERROR=1
else
echo "✅ Copyright notice found in: $file"
fi
done
Expand Down

0 comments on commit ad38fb5

Please sign in to comment.