Last active
April 25, 2017 01:18
-
-
Save igaiga/637d41f12dd7b844386622712be01f4b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env ruby | |
# https://github.com/masutaka/compare_linker | |
# 使い方 | |
# bundle updateします | |
# コミット、プッシュしてPR作ります | |
# このファイルにPR番号やアクセストークンを書くか、実行時に以下のように指定します。 | |
# $ PR_NUMBER=7777 OCTOKIT_ACCESS_TOKEN=xxxxxx bin/compare_linker | |
# PRにコメントが投稿されてます | |
require 'bundler/setup' | |
require 'compare_linker' | |
branch = 'igaiga/awesome_app' | |
pr_number = ENV['PR_NUMBER'] || '5555' | |
ENV['OCTOKIT_ACCESS_TOKEN'] ||= 'github personal access token' | |
# token is made at user settings page - personal access token tab | |
# https://github.com/settings/tokens | |
compare_linker = CompareLinker.new(branch, pr_number) | |
compare_linker.formatter = CompareLinker::Formatter::Markdown.new | |
comment = compare_linker.make_compare_links.to_a.join("\n") | |
compare_linker.add_comment(branch, pr_number, comment) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment