2020-07-21 00:19:10 +08:00
|
|
|
#!/usr/bin/env bash
|
2020-07-21 00:40:22 +08:00
|
|
|
set -euo pipefail
|
2020-07-21 00:19:10 +08:00
|
|
|
IFS=$'\n\t'
|
|
|
|
|
2020-07-21 00:49:25 +08:00
|
|
|
if [ ! -n "$SSHPRIVKEY" ]; then
|
2020-07-21 00:19:10 +08:00
|
|
|
echo SSHPRIVKEY is not set
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-07-21 00:40:22 +08:00
|
|
|
|
2020-07-21 00:19:10 +08:00
|
|
|
mkdir -p "$HOME/.ssh"
|
|
|
|
echo "$SSHPRIVKEY" | base64 -d >"$HOME/.ssh/id_ed25519"
|
|
|
|
chmod 0600 "$HOME/.ssh/id_ed25519"
|
2020-07-21 00:40:22 +08:00
|
|
|
|
|
|
|
set -x
|
|
|
|
|
|
|
|
pushd generated
|
|
|
|
git add .
|
2020-07-21 00:19:10 +08:00
|
|
|
git config user.name "neonet roa bot"
|
|
|
|
git config user.email "bot@github.com"
|
|
|
|
git commit -m "Generated at $(TZ='UTC' date +%Y%m%d-%H%M%S.%N)"
|
|
|
|
git push --force --quiet "git@github.com:NeoCloud/NeoNetwork-ROA.git" HEAD:master
|