From 62282f95529e3f1d07e650ce0e4f26547c4233b3 Mon Sep 17 00:00:00 2001 From: Julien Bouquillon Date: Fri, 23 Jun 2023 01:50:58 +0200 Subject: [PATCH] chore: autoupdate --- .github/workflows/update-datagouv.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update-datagouv.yml b/.github/workflows/update-datagouv.yml index b8773ad..787c0dc 100644 --- a/.github/workflows/update-datagouv.yml +++ b/.github/workflows/update-datagouv.yml @@ -31,14 +31,17 @@ jobs: echo "Check validity" cat ./WEEZ.csv | grep 78012998704037 # check if its a new file - gzip ./WEEZ.csv - DIFFED=$(diff ./WEEZ.csv.gz ./data/WEEZ.csv.gz) || true - if [[ $DIFFED ]]; then + gunzip ./data/WEEZ.csv.gz + if [[ $(diff ./WEEZ.csv ./data/WEEZ.csv) ]]; then echo "File changed" + gzip -v ./WEEZ.csv + gzip -t ./WEEZ.csv.gz + echo "move" mv ./WEEZ.csv.gz ./data/WEEZ.csv.gz + exit 0 else echo "File not changed" - rm ./WEEZ.csv.gz + rm ./WEEZ.csv exit 1 fi; @@ -46,5 +49,6 @@ jobs: uses: stefanzweifel/git-auto-commit-action@v4 if: steps.download.outcome == 'success' with: + file_pattern: "data/*" commit_message: "fix: Update datagouv data" commit_author: "GitHub bot "