Slide 22
Slide 22 text
1 pullrequest_body=`bundle diffgems -f md_table | ruby -e "require 'json'; print JSON.generate(STDIN.read, quirks_mode: true)"`
2 branch_name=bundle_update_$CIRCLE_BUILD_NUM
3 git checkout -b $branch_name
4 git commit -m 'Bundle update' -- Gemfile.lock
5
6 if [[ $pullrequest_body = *"rubocop"* ]]; then
7 bundle exec rubocop --auto-gen-config
8 git add .rubocop_todo.yml
9 git commit -m 'bundle exec rubocop --auto-gen-config'
10 fi
11
12 if [[ $pullrequest_body = *"webpacker"* ]]; then
13 regexp="\[webpacker\]\(https://github\.com/rails/webpacker\) \| [0-9]+\.[0-9]+\.[0-9]+ \| ([0-9]+\.[0-9]+\.[0-9]+) \|"
14 if [[ $pullrequest_body =~ $regexp ]]; then
15 yarn upgrade @rails/webpacker@${BASH_REMATCH[1]}
16 git add package.json yarn.lock
17 git commit -m "yarn upgrade @rails/webpacker@${BASH_REMATCH[1]}"
18 fi
19 fi
20
21 git push origin $branch_name
22 curl -X POST -H "Authorization: token $GITHUB_ACCESS_TOKEN" --data "{\"title\": \"bundle update $CIRCLE_BUILD_NUM\", \"head\":
\"$branch_name\", \"base\": \"master\", \"body\": $pullrequest_body}" https://api.github.com/repos/:organization/:repository/pulls
w CVOEMFVQEBUF
w ಛఆͷHFN͕VQEBUF͞Εͨ࣌ͷϑοΫॲཧ