From f457d43fdeb280fcc37c02d42d3671051a222c96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Sat, 30 Nov 2024 09:49:21 +0100 Subject: [PATCH] Fixed glob and dots in links --- .github/workflows/preview_comment.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preview_comment.yaml b/.github/workflows/preview_comment.yaml index 23f9656b3f..40e0ceb6ab 100644 --- a/.github/workflows/preview_comment.yaml +++ b/.github/workflows/preview_comment.yaml @@ -33,9 +33,11 @@ jobs: comment="Preview of modified files: too many files modified in a single PR. Unable to post preview links, sorry!" else filenames=$(echo "$changed_files" | rev | cut -d / -f 1 | rev | cut -d . -f 1) - urls=$(echo "$changed_files" | cut -d / -f 2- | cut -d '.' -f 1 | sed -e "s ^ $build_url ") - left=$(yes "* [" | head -n "$number_of__changed_files" ) + # Guess the URL based on Markdown file location. Remove the .md extension. + urls=$(echo "$changed_files" | cut -d / -f 2- | rev | cut -d '.' -f 2- | rev | sed -e "s ^ $build_url ") + + left=$(yes "+ [" | head -n "$number_of__changed_files" ) middle=$(yes "](" | head -n "$number_of__changed_files" ) right=$(yes ")\n" | head -n "$number_of__changed_files" )