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. <merceyz@users.noreply.github.com>
This commit is contained in:
Antoine du Hamel 2024-06-06 14:20:01 +02:00 committed by GitHub
parent e1d8ffd775
commit 3da534695e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

View File

@ -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