mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-04-28 05:10:40 +00:00
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.
This commit is contained in:
+3
-2
@@ -214,11 +214,12 @@ jobs:
|
|||||||
total=$((total + 1))
|
total=$((total + 1))
|
||||||
slug=$(basename "$script" | sed 's/-install\.sh$//')
|
slug=$(basename "$script" | sed 's/-install\.sh$//')
|
||||||
|
|
||||||
# Extract Source URL (GitHub only)
|
# Extract Source URL (GitHub only) from the "# Source:" line
|
||||||
# Supports both:
|
# Supports both:
|
||||||
# # Source: https://github.com/owner/repo
|
# # Source: https://github.com/owner/repo
|
||||||
# # Source: https://example.com | Github: 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
|
if [[ -z "$source_url" ]]; then
|
||||||
report_lines+=("| \`$slug\` | — | — | — | — | ⏭️ No GitHub source |")
|
report_lines+=("| \`$slug\` | — | — | — | — | ⏭️ No GitHub source |")
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user