Skip to content

Commit

Permalink
Create release pull request with octokit (jjochen#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjochen authored Jan 10, 2018
1 parent 724b8f0 commit 6dc2334
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,25 @@ end
def open_pull_request(version)
title "Opening pull request"
check_parameter(version)
sh "open 'https://github.com/jjochen/JJFloatingActionButton/compare/release%2F#{version}?expand=1'"

repo = "jjochen/JJFloatingActionButton"
base = "master"
release_branch = "release/#{version}"
title = "Release #{version}"

puts "repo: #{repo}"
puts "base: #{base}"
puts "head: #{release_branch}"

client = Octokit::Client.new :access_token => ENV['JJ_GITHUB_TOKEN']

pull_request = client.create_pull_request repo, base, release_branch, title
puts "#{pull_request.title} created."
puts pull_request.html_url

client.add_labels_to_an_issue repo, pull_request.number, ['release']
puts "release label added."

sh "open #{pull_request.html_url}"
end

0 comments on commit 6dc2334

Please sign in to comment.