File tree Expand file tree Collapse file tree
.github/workflows/scripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,10 +63,13 @@ if [ ! -f "$SITEMAP_INDEX" ]; then
6363fi
6464
6565# Extract sitemap paths
66- sitemap_paths=$( awk -F ' <loc>|</loc> ' ' /<loc>/{print $2} ' " $SITEMAP_INDEX " )
66+ sitemap_paths=$( grep -oE ' <loc>[^<]+ ' " $SITEMAP_INDEX " | sed ' s /<loc>// ' )
6767if [ -z " $sitemap_paths " ]; then
6868 echo " No sitemap entries found in sitemap index" >&2
6969 exit 1
70+ else
71+ printf " Found %d Sitemaps to scan.\n" " $( printf " %s\n" " $sitemap_paths " | wc -l) "
72+ echo $sitemap_paths
7073fi
7174
7275url_list=" "
@@ -77,7 +80,7 @@ while IFS= read -r sitemap_url; do
7780 echo " Warning: missing $local_path , skipping…" >&2
7881 continue
7982 fi
80- page_urls=$( awk -F ' <loc>|</loc> ' ' /<loc>/{print $2} ' " $local_path " | grep -v ' \.xml$ ' )
83+ page_urls=$( grep -oE ' <loc>[^<]+ ' " $local_path " | sed ' s/<loc>// ' )
8184 url_list=" ${url_list} " $' \n ' " ${page_urls} "
8285done <<< " $sitemap_paths"
8386
You can’t perform that action at this time.
0 commit comments