Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): better check for Nocks changes #491

Merged
merged 2 commits into from
Jun 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/update-nock-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +54 to +55
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Rather than the cp, you could use git show to dump the old content in a /tmp file without mutating the real nocks.db.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've considered it, and as I was not sure what would be the behavior of git show with binary files, I decided to do that cp dance instead. I don't feel strongly either way, happy to change it if you think it's better

Copy link
Contributor

@arcanis arcanis Jun 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd expect it to be possible but I can't find the right syntax locally (I get no output), so feel free to merge as-is.

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
Expand Down
Loading