From d48a7d844f871db01d317ca7d12060ee6ea7ddf5 Mon Sep 17 00:00:00 2001 From: Nicolas Brugneaux Date: Thu, 19 Oct 2023 18:27:45 +0200 Subject: [PATCH] fix: prevent the action from failing when diff is dirty --- .github/workflows/cron.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index f8d13f8..eb37acf 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -28,8 +28,9 @@ jobs: - name: Sets a flag if the list was changed id: diff_flag run: | - git diff --exit-code ofac.sanctions.json - echo "GIT_EXIT_CODE=$?" >> $GITHUB_OUTPUT + RESULT=$(git diff --name-only ofac.sanctions.json) + [[ "$RESULT" = "" ]] && GIT_EXIT_CODE=0 || GIT_EXIT_CODE=1 + echo "GIT_EXIT_CODE=$GIT_EXIT_CODE" >> $GITHUB_OUTPUT >> $GITHUB_OUTPUT - uses: stefanzweifel/git-auto-commit-action@v5 with: