awesome-docker/push.sh

27 lines
718 B
Markdown
Raw Normal View History

2018-07-19 05:59:07 -04:00
#!/usr/bin/env bash
# Exit immediately if a command returns a non-zero status.
set -e
# Set git credentials
git config --global user.email "info@veggiemonk.ovh"
git config --global user.name "veggiemonk-bot"
# let git know where to apply the changes
git checkout master
echo "Adding data files"
2018-07-19 05:59:07 -04:00
git add data/*
echo "Checking the number of files staged"
files=$(git diff --cached --numstat | wc -l | tr -d '[:space:]');
[[ $files -eq 0 ]] && echo "nothing to push, exiting..." && exit
2018-07-19 05:59:07 -04:00
echo "Commiting files"
git commit -m "Automated update repository metadata [skip ci]"
echo "Pushing changes"
2018-07-19 05:59:07 -04:00
git push https://$GITHUB_USER:$GITHUB_TOKEN@github.com/veggiemonk/awesome-docker master >/dev/null 2>&1
echo "Done."