Created
March 3, 2015 11:45
-
-
Save juno/a100761e5d14d3c7ea5d to your computer and use it in GitHub Desktop.
Fetch pull request id by branch name using github api v3
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
require 'octokit' | |
owner = 'juno' | |
repo = 'foo' | |
branch_name = 'fix-issue-1' | |
Octokit::Client.new(access_token: ENV['GITHUB_ACCESS_TOKEN']) | |
pull_id = client.pulls("#{owner}/#{repo}", head: "#{owner}:#{branch_name}").first.number |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment