Skip to content

Instantly share code, notes, and snippets.

@borischerkasky
Created August 10, 2019 16:28
Show Gist options
  • Save borischerkasky/ccd23e01b173f9350a38dcc714930e2e to your computer and use it in GitHub Desktop.
Save borischerkasky/ccd23e01b173f9350a38dcc714930e2e to your computer and use it in GitHub Desktop.
get pullrequest from github
username 'put your username here'
token = 'put your personal token from GitHub here, prefeably via ENV VAR'
auth = { username: uname, password: token }
url = "https://api.github.com/repos/#{owner}/#{repo_name}/pulls?per_page=1&state=all"
res = HTTParty.get(url, basic_auth: auth)
body = JSON.parse(res.body)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment