From 3da534695e357459e45d250d60947bfdcd59d7e0 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Thu, 6 Jun 2024 14:20:01 +0200 Subject: [PATCH] chore(ci): better check for Nocks changes (#491) When there are no changes, asking Git to compare the db file directly will always report change even though the actual data stored is the same. Instead, we can compare a SQL dump to detect actual changes. Co-authored-by: Kristoffer K. --- .github/workflows/update-nock-files.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-nock-files.yml b/.github/workflows/update-nock-files.yml index 60f8acb..5f3426e 100644 --- a/.github/workflows/update-nock-files.yml +++ b/.github/workflows/update-nock-files.yml @@ -49,7 +49,13 @@ jobs: - name: Check if anything has changed id: contains-changes - run: echo "result=$(git --no-pager diff --quiet -- tests/nocks.db || echo "yes")" >> $GITHUB_OUTPUT + run: | + sqlite3 tests/nocks.db .dump > /tmp/before.sql + cp tests/nocks.db tests/nocks.db.new + git checkout HEAD -- tests/nocks.db + sqlite3 tests/nocks.db .dump > /tmp/after.sql + echo "result=$(git --no-pager diff --quiet --no-index /tmp/before.sql /tmp/after.sql || echo "yes")" >> "$GITHUB_OUTPUT" + mv tests/nocks.db.new tests/nocks.db shell: bash - name: Commit changes