Last active
December 28, 2015 18:09
-
-
Save idesaku/7540801 to your computer and use it in GitHub Desktop.
bundle update automation helper Create a pull request if any updates are there.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
OWNER="owner name" | |
REPO="repo name" | |
OAUTH_TOKEN="your oauth token" | |
git checkout master | |
git pull --rebase | |
bundle update | |
git diff --exit-code Gemfile.lock > /dev/null 2>&1 | |
if [ "$?" = "0" ]; then | |
exit 0 | |
fi | |
topic_branch_name="`date +%Y%m%d%H%M%S`_bundle_update" | |
git checkout -b $topic_branch_name | |
git commit -am 'bundle update' | |
git push origin $topic_branch_name | |
curl --fail --data-ascii "{ | |
\"title\": \"bundle update\", | |
\"head\": \"$topic_branch_name\", | |
\"base\": \"master\" | |
}" \ | |
-H "Authorization: token $OAUTH_TOKEN" \ | |
https://api.github.com/repos/$OWNER/$REPO/pulls |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment