Skip to content

Commit

Permalink
improve logging
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Heinrich <[email protected]>
  • Loading branch information
andistorm committed Jul 8, 2024
1 parent 26f6e86 commit 1cdcdae
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/deploy-single-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1cdcdae

Please sign in to comment.