Skip to content

Commit ad38fb5

Browse files
committed
Better copyright workflow: exclude some extensions
1 parent 3b60d30 commit ad38fb5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/copyright.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,20 @@ jobs:
4444
continue
4545
fi
4646
47+
# Skip CSV, SVG files and known binary extensions
48+
extension="${file##*.}"
49+
if [[ "${extension,,}" =~ ^(csv|svg|png|jpg|jpeg|gif|ico)$ ]]; then
50+
echo "ℹ️ Skipping $file (excluded file type)"
51+
continue
52+
fi
53+
4754
# Check if file contains the copyright string with current year
4855
# Pattern matches either:
4956
# @copyright Copyright (c) 2024 Maho (https://mahocommerce.com)
5057
# @copyright Copyright (c) (2024-)2024 Maho (https://mahocommerce.com)
5158
if ! grep -E -q "Copyright \(c\) (\(2024-\))?${CURRENT_YEAR} Maho \(https://mahocommerce\.com\)" "$file"; then
5259
echo "❌ Copyright notice missing in: $file"
5360
ERROR=1
54-
else
55-
echo "✅ Copyright notice found in: $file"
5661
fi
5762
done
5863

0 commit comments

Comments
 (0)