Reputation: 53
I am the admin of a GitHub organization. I have set up a Repository webhook for the organization. I am using ngrok to communicate to a local sinatra instance. Here is my server.rb file:
require 'sinatra'
require 'json'
set :port, 1234
post '/payload' do
push = JSON.parse(request.body.read)
puts "I got some JSON: #{push.inspect}"
end
I receive a JSON payload when a repository is created. I would like to automatically create an issue in this new repository with a name and description. I'm assuming I need to use a gem to interact with GitHub API, so I chose octokit. I was able to authenticate, but I'm having trouble seeing how to interact with the API. I would like to create an issue in the newly created GitHub repository. Could I see some examples on ho this is used?
Reference: https://developer.github.com/v3/issues/#create-an-issue
Upvotes: 0
Views: 995
Reputation: 22926
Octokit.create_issue("sferik/rails_admin", 'Updated Docs', 'Added some extra links')
http://octokit.github.io/octokit.rb/Octokit/Client/Issues.html#create_issue-instance_method
Upvotes: 1