This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Julien Bouquillon
committed
Jun 22, 2023
1 parent
7e05fa0
commit 62282f9
Showing
1 changed file
with
8 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,20 +31,24 @@ 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; | ||
- name: Commit changes | ||
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 <[email protected]>" |