Skip to content

Instantly share code, notes, and snippets.

@skateman
Created April 20, 2017 14:09
Show Gist options
  • Save skateman/795a8367a16d7dbde3f5e4d1b4ebc403 to your computer and use it in GitHub Desktop.
Save skateman/795a8367a16d7dbde3f5e4d1b4ebc403 to your computer and use it in GitHub Desktop.
#!/bin/env ruby
# Script to approve a GitHub PR from the command line
#
# Usage: ./approve.rb <repo> <PR>
# For auth configuration see: https://github.com/octokit/octokit.rb#using-a-netrc-file
require 'octokit'
require 'netrc'
client = Octokit::Client.new(:netrc => true)
client.create_pull_request_review(ARGV[0], ARGV[1], :event => 'APPROVE', :body => "![LGTM](http://www.skateman.eu/seal.jpg)")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment