mirror of https://github.com/nodejs/corepack.git
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:
parent
e1d8ffd775
commit
3da534695e
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue