Skip to content

Commit

Permalink
Fix changes detection
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Heinrich <andreas.heinrich@rwth-aachen.de>
  • Loading branch information
andistorm committed Jul 9, 2024
1 parent c250e5a commit 3c99ef4
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/deploy-single-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,18 @@ jobs:
id: check
run: |
echo "Checking for changes in paths ${{ steps.setup-regex.outputs.regex }}.."
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
changed_files="$(git diff --name-only ${{ inputs.github_ref_before }} ${{ inputs.github_ref_after }} | grep -E '${{ steps.setup-regex.outputs.regex }}')" || EXIT_CODE=$?
if [ "$EXIT_CODE" -eq "1" ]; then
echo "No changes detected in ${{ steps.setup-regex.outputs.regex }}!🔍"
echo "changes_detected=false" >> $GITHUB_OUTPUT
exit 0
elif [ "$EXIT_CODE" -ne "0" ]; then
echo "Error while checking for changes in ${{ steps.setup-regex.outputs.regex }}!❌"
exit $EXIT_CODE
else
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
fi
working-directory: source
- name: Set outputs
Expand Down

0 comments on commit 3c99ef4

Please sign in to comment.