From e2a83549cb1ca77a79a058d8e64cd54a75160f3d Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Thu, 26 Feb 2026 14:08:45 +0100 Subject: [PATCH] Restrict GitHub source extraction to '# Source:' When extracting GitHub source URLs in the workflow, only search the "# Source:" line first to avoid matching other URLs (such as license links). Update the grep pipeline to filter for the Source line (case-insensitive) before extracting the https://github.com/... pattern and add explanatory comments. --- .github/workflows/check-node-versions.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-node-versions.yml b/.github/workflows/check-node-versions.yml index b45379719..d0cacf8ba 100644 --- a/.github/workflows/check-node-versions.yml +++ b/.github/workflows/check-node-versions.yml @@ -214,11 +214,12 @@ jobs: total=$((total + 1)) slug=$(basename "$script" | sed 's/-install\.sh$//') - # Extract Source URL (GitHub only) + # Extract Source URL (GitHub only) from the "# Source:" line # Supports both: # # Source: https://github.com/owner/repo # # Source: https://example.com | Github: https://github.com/owner/repo - source_url=$(head -20 "$script" | grep -oP 'https://github\.com/[^\s|]+' | head -1 || echo "") + # NOTE: Must filter for "# Source:" line first to avoid matching the License URL + source_url=$(head -20 "$script" | grep -i '# Source:' | grep -oP 'https://github\.com/[^\s|]+' | head -1 || echo "") if [[ -z "$source_url" ]]; then report_lines+=("| \`$slug\` | — | — | — | — | ⏭️ No GitHub source |") continue