Skip to content

Commit

Permalink
Add weekly hash check
Browse files Browse the repository at this point in the history
  • Loading branch information
dc-almeida committed Nov 20, 2024
1 parent 99bf1dc commit 6e798fc
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/check_hash.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Compare File Hash Weekly

on:
schedule:
- cron: '0 0 * * 0' # Runs weekly on Sunday at midnight UTC

jobs:
compare-hash:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Calculate Local File Hash
id: local-hash
run: echo "LOCAL_HASH=$(sha256sum pysquirrel/data/NUTS2021-NUTS2024.xlsx | awk '{print $1}')" >> $GITHUB_ENV

- name: Download File
run: curl -o most-recent-version.xlsx "https://ec.europa.eu/eurostat/documents/345175/629341/NUTS2021-NUTS2024.xlsx"

- name: Calculate Downloaded File Hash
id: downloaded-hash
run: echo "DOWNLOADED_HASH=$(sha256sum most-recent-version.xlsx | awk '{print $1}')" >> $GITHUB_ENV

- name: Compare Hashes
run: |
if [ "$LOCAL_HASH" != "$DOWNLOADED_HASH" ]; then
echo "Hashes do not match!"
exit 1
else
echo "Hashes match!"
fi
Binary file added pysquirrel/data/NUTS2021-NUTS2024.xlsx
Binary file not shown.

0 comments on commit 6e798fc

Please sign in to comment.