Some checks failed
format / build (push) Failing after 6s
Signed-off-by: ngn <ngn@ngn.tf>
24 lines
462 B
Bash
24 lines
462 B
Bash
#!/bin/bash
|
|
|
|
if [ ! -f ups.json ]; then
|
|
echo "ups.json not found"
|
|
exit 1
|
|
fi
|
|
|
|
git add ups.json
|
|
|
|
if git diff --exit-code --cached &> /dev/null; then
|
|
echo "no updates for ups.json"
|
|
exit 1
|
|
fi
|
|
|
|
diff=$(git blame ups.json | grep 'Not Committed Yet' | grep '"commit"')
|
|
|
|
if [ -z "${diff}" ]; then
|
|
echo "no updates for ups.json"
|
|
exit 1
|
|
fi
|
|
|
|
commit=$(echo "${diff}" | awk '{print $10}' | sed -e 's/"//g' -e 's/,//g')
|
|
git commit -m "ups: update to ${commit:0:7}"
|