]> git.ipfire.org Git - thirdparty/ut1-blacklists.git/commitdiff
Compress big files before adding them to git as GitHub prevent to push files bigger...
authorLuc Sarzyniec <devel@olbat.net>
Sat, 2 Apr 2022 10:40:42 +0000 (12:40 +0200)
committerLuc Sarzyniec <devel@olbat.net>
Sat, 2 Apr 2022 10:40:42 +0000 (12:40 +0200)
scripts/sync-git

index b1ef71faaaf793c26546662f3c67452a515b0586..15371f461ce4027d927707cdbb1d046fd8071ad9 100755 (executable)
@@ -3,11 +3,15 @@
 GIT_REMOTE="https://${GITHUB_TOKEN}@github.com/olbat/ut1-blacklists"
 GIT_BRANCH="master"
 
-set -e
-set -x
+set -euxo pipefail
 
-# if there is some changes in the repository: commit, tag and push them
+# compress files that are bigger than 100M as GitHub doesn't allow to
+# push files of that size anymore
+find blacklists -type f -size +99M -exec gzip -nf {} \;
+
+# if there are some changes in the repository: commit, tag and push them
 git add -N blacklists/
+
 if ! git diff --exit-code -- . ':!blacklists/README' > /dev/null
 # (do not take in account changes that only affects the blacklists/README file
 # since this file is updated every day with the date)