From ddfbd43b04455a6c8ffecf3afb87256699e16fa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Fri, 29 Nov 2024 19:36:44 +0100 Subject: [PATCH] Fixed no files --- .github/workflows/preview_comment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preview_comment.yaml b/.github/workflows/preview_comment.yaml index cabc3cd6c6..016861c0ca 100644 --- a/.github/workflows/preview_comment.yaml +++ b/.github/workflows/preview_comment.yaml @@ -22,10 +22,10 @@ jobs: file_limit=100 build_url="https://ez-systems-developer-documentation--${{ github.event.pull_request.number }}.com.readthedocs.build/en/${{ github.event.pull_request.number }}/" - changed_files=$(git diff --name-only HEAD origin/$GITHUB_BASE_REF | grep -E ".md$") + changed_files=$(git diff --name-only HEAD origin/$GITHUB_BASE_REF | grep -E ".md$" || [[ $? == 1 ]]) number_of__changed_files=$(echo $changed_files | wc -l) - if [[ $number_of__changed_files -eq 0 ]] then: + if [[ $changed_files -eq "" ]] then: comment="No markdown files changed, no preview needed." elif [[ $number_of__changed_files -gt file_limit ]] then: comment="Too many files modified in a single PR. Unable to post preview links, sorry!"