A Ruby toolkit for the GitHub API.
Questions tagged [octokit]
166 questions
9
votes
2 answers
Getting all files for repository using OctoKit
I want to get all informations about files from my github repository using octokit
projectis: http://octokitnet.readthedocs.org/en/latest/contributing/
Updated:
what I thought I can do is
getAllFilesFromRepository
that will return json with…

cpoDesign
- 8,953
- 13
- 62
- 106
6
votes
0 answers
Hide Github Action when completed on Pull Request
I have a GitHub action that evaluates something and then creates a Status Check with the result.
setup is the one that evaluates and linting is the result (a different status check with all the information). This is done because the default status…

Javier Bullrich
- 389
- 1
- 5
- 22
6
votes
4 answers
How to correctly replicate response body of an Octokit requests' response for webmock stub
Octokit responses are of type Sawyer::Response
They look like this:
{:name=>"code.py",
:content => "some content"}
I am trying to stub my request like so
reponse_body = {:content => "some content"}
stub_request(:any,…
user1571609
6
votes
1 answer
Output a repos URLs using Octokit.rb
I'm attempting to list details of a Github accounts repos using Octokit.rb, but can't seem to find the associated URLs.
In the first instance all I need to do is authenticate with the Github API using OAuth and output the details to the console.…

Matt Weldon
- 1,413
- 11
- 18
5
votes
3 answers
List all unresolved pull request comments
We are using the @octokit/rest client to fetch all of the comments on a pull request:
client.pulls
.listComments({
owner,
repo,
pull_number: 34,
per_page: 100,
})
.then((result) => {
console.log(result.data.length);
…

Shaun Luttin
- 133,272
- 81
- 405
- 467
5
votes
2 answers
Use Octokit to retrieve private repositories from organizations
I'm trying to retrieve all repositories from a certain user's organization using the Octokit gem for ruby.
I have this client variable:
@client = Octokit::Client.new(access_token: TOKEN)
And when I use this:
@client.repos
I'm able to retrieve all…

Igor_Marques
- 1,742
- 2
- 16
- 24
5
votes
1 answer
How to get the number of commits between 2 git tags using octokit.net?
I want to be able to get the total number of commits in a github repository between 2 git tags using octokit.net (Github .NET API).
Same as what the compare in github does.

John Simons
- 4,288
- 23
- 41
5
votes
1 answer
github api v3 create issue message not found
when i try to create an github issue it gives message not found reply. and also how to send authentication headers with this. because creating issues requires user to be logged in or authenticated
curl -X POST -i -d…

surendar
- 656
- 1
- 9
- 27
4
votes
0 answers
Octokit rest.js throws a httpError: Not Found
Im trying to update an existing gist using Octokit. I can successfully get the gist but I cannot update the gist. It always throws an httpError: Not Found.
Heres my code:
const request = require('request-promise');
const Octokit =…

Suvin Nimnaka Sukka
- 341
- 1
- 7
- 21
4
votes
1 answer
Use Octokit or the GitHub Rest API to upload multiple files
I'm trying to write a method which takes files from a path and uploads them to a GitHub repo. The files have to remain intact and separate (can't zip them). This is what I've got so far:
addFiles(branch) {
const filePath = this.filePath
…

Alex Foxleigh
- 1,784
- 2
- 21
- 47
4
votes
1 answer
Using the Github API is it possible to determine if a branch is ahead of the default branch?
Using the Github API (no local git commands), is it possible to compare a branch to see if it has any changes ahead of the default branch?
I'm building an auditing tool, and would like to identify branches that are candidates to be closed, because…

theraven
- 4,825
- 3
- 20
- 20
4
votes
1 answer
Is there any way to get repository insights via the GitHub Rest API v3
I want to get statistics for the number of issues opened/closed for a repository during a specified period of time. I can view this information in GitHub by clicking the insights tab.
For example: https://github.com/nodejs/node/pulse
Can I pull any…

sgonzalez
- 741
- 6
- 20
4
votes
1 answer
How to avoid delaying github pull request merge using API
I am using the Github API via Octokit and have noticed a strange behavior. In one scenario I am programatically syncing master across 2 forks. I need to:
Open a pull request from repo1:master to repo2:master
Merge that pull request
When I first…

Kallin Nagelberg
- 989
- 8
- 17
4
votes
1 answer
GitHub API: Tag a commit belongs to ( parallel for git describe --tag )
I am experimenting with GitHub API using octokit ruby gem. My goal is to be able to extract the 'tag' that a commit SHA belongs to.
Now I can easily do this on command line using
> git describe 688ae0b --tags
and get output
> 3.0.1-122-g688ae0b…

Shaunak
- 17,377
- 5
- 53
- 84
4
votes
1 answer
how to get the date of a commit using octokit.rb
So I can grab the commits from a repo using:
commits = Octokit.commits('tansaku/gitimmersion')
but I can't work out how to get the date of a commit. If I pp an individual commit I can see dates are present:
#

Sam Joseph
- 4,584
- 4
- 31
- 47