From ad38fb5238b5eed0fdbba7465d4818f912f81008 Mon Sep 17 00:00:00 2001 From: Fabrizio Balliano Date: Sun, 24 Nov 2024 20:54:17 +0000 Subject: [PATCH] Better copyright workflow: exclude some extensions --- .github/workflows/copyright.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/copyright.yml b/.github/workflows/copyright.yml index c33e23d7f..47a85c424 100644 --- a/.github/workflows/copyright.yml +++ b/.github/workflows/copyright.yml @@ -44,6 +44,13 @@ 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) @@ -51,8 +58,6 @@ jobs: 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