vuln-list-update/scripts/update.sh
fl0pp5 8a32973818
All checks were successful
Update vuln-list-alt repo / Update vuln-list-alt (push) Successful in 5m15s
increase git POST request buffer size
2024-06-28 16:13:18 +03:00

33 lines
567 B
Bash
Executable File

#!/bin/bash -eu
TARGET=$1
COMMIT_MSG=$2
if [ -z "$TARGET" ]; then
echo "target required"
exit 1
fi
if [ -z "$COMMIT_MSG" ]; then
echo "commit message required"
exit 1
fi
result=0
./vuln-list-update -vuln-list-dir "$VULN_LIST_DIR" -target "$TARGET" || result=$?
if [ $result -ne 0 ]; then
echo "[Err] Revert changes" >&2
cd "$VULN_LIST_DIR" && git reset --hard HEAD
exit 1
fi
cd "$VULN_LIST_DIR" || exit 1
if [[ -n $(git status --porcelain) ]]; then
git config http.postBuffer 157286400
git add .
git commit -m "${COMMIT_MSG}"
git push
fi