Tbpgr Blog

Employee Experience Engineer tbpgr(てぃーびー) のブログ

Octokit で GitHub の Issue を作成する

f:id:tbpg:20161209234655p:plain

Octokit で GitHub の Issue を作成します。
※この記事は個人メモです。既出情報のため、元から知っている人は特に得るものがありません

サンプル

環境変数の取得に dotenv を使っています。
dotenv については以下を参照ください。

qiita.com

Gemfile

source "https://rubygems.org"

gem "dotenv"
gem "octokit"
$ bundle install

コード

require 'octokit'
require 'dotenv'

Dotenv.load
client = Octokit::Client.new(:access_token => ENV['GITHUB_TOKEN'])
client.create_issue("tbpgr/eto", 'title', 'description')

結果

f:id:tbpg:20161209234655p:plain