From 65cc26377e8ea4eb9614951f106381dd6c4a6ecc Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Sat, 16 Dec 2023 13:27:16 +0100 Subject: Add check for new regexes before updating repo --- .github/workflows/generate-constants.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/generate-constants.yaml b/.github/workflows/generate-constants.yaml index 9df66081c..fccadc7fb 100644 --- a/.github/workflows/generate-constants.yaml +++ b/.github/workflows/generate-constants.yaml @@ -51,6 +51,12 @@ jobs: - name: Commit generated regex run: | mkdir -p constants/ + new_cmp="$(jq -S '.regexes' < constants.json)" + old_cmp="$(jq -S '.regexes' < constants/regexes.json)" + if [ "$new_cmp" = "$old_cmp" ]; then + echo Old and new are the same. We are in a never ending loop. + exit 0 + fi mv constants.json constants/regexes.json git config user.name 'github-actions[bot]' git config user.email 'github-action@users.noreply.github.com' -- cgit