From 1cdcdae20d00dc78afb0b85b221b86ea98494749 Mon Sep 17 00:00:00 2001 From: Andreas Heinrich Date: Mon, 8 Jul 2024 15:07:10 +0200 Subject: [PATCH] improve logging Signed-off-by: Andreas Heinrich --- .github/workflows/deploy-single-docker-image.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-single-docker-image.yml b/.github/workflows/deploy-single-docker-image.yml index 8122d47..a16028d 100644 --- a/.github/workflows/deploy-single-docker-image.yml +++ b/.github/workflows/deploy-single-docker-image.yml @@ -116,15 +116,18 @@ jobs: # set the regex as an output with open(os.environ["GITHUB_OUTPUT"], "a") as f: f.write(f"regex={regex}\n") + print(f"Set regex={regex}") - name: Get changed files if: steps.validate-inputs.outputs.validation_failed == 'false' id: check run: | echo "Checking for changes in ${{ inputs.directory }}.." - changed_files="$(git diff --name-only ${{ inputs.github_ref_before }} ${{ inputs.github_ref_after }} | grep -E '${{ steps.setup-regex.outputs.regex }}' | wc -l)" - if [ $changed_files -gt 0 ]; then - echo "Changes detected in ${{ steps.setup-regex.outputs.regex }}!🔍" - echo "changed_detected=true" >> $GITHUB_OUTPUT + changed_files="$(git diff --name-only ${{ inputs.github_ref_before }} ${{ inputs.github_ref_after }} | grep -E '${{ steps.setup-regex.outputs.regex }}')" + changed_files_count=$(echo "$changed_files" | wc -l) + if [ $changed_files_count -gt 0 ]; then + echo "🔍 Changes detected with regex ${{ steps.setup-regex.outputs.regex }} in the following files:" + echo "$changed_files" + echo "changes_detected=true" >> $GITHUB_OUTPUT else echo "No changes detected in ${{ steps.setup-regex.outputs.regex }}!🔍" echo "changes_detected=false" >> $GITHUB_OUTPUT