github-api

Is there a way to get the latest tag of a given repo using github API v3

做~自己de王妃 提交于 2019-12-20 09:54:08
问题 I am relatively new to the github api and I am struggling to get the latest tag of a given repo. Q: Why I need that ? A: As a QA I am responsible for testing and releasing to LIVE and our team owns around 40 artefacts(repos in github). I want to build a tool which lists the projects which have commits after that latest tag. So that I can manage releases more efficiently. Coming to the point. According to Github api to get all tags of a give repo is GET /repos/:owner/:repo/tags But this gives

How to list all GitHub users?

一曲冷凌霜 提交于 2019-12-20 09:54:00
问题 I'm working on a site, need to crawl all user information (at least the user on our site) from GitHub. I searched GitHub API, and found no answer. So is there any way I can do this job? I only have the users emails. (I can check user by compare the email hash with gravatar URL) I had send email to GitHub support, and got no answer currently. I only need know the usernames, I can use GitHub API to get other informations. 回答1: As described here you may rely on those two following APIs to

Getting repository information using pygithub3 for Python

一曲冷凌霜 提交于 2019-12-20 05:51:21
问题 I'm trying to access the language used in each repository given a Github username. In order to do this, so far my python code is: from pygithub3 import Github username = raw_input("Please enter a Github username: ") password = raw_input("Please enter the account password: ") gh = Github(login=username, password = password) get_user = gh.users.get() user_repos = gh.repos.list().all().language print user_repos However, the list object apparently doesn't have any language attribute, so I don't

POST to GitHub v3 API using ajax and JavaScript fails with a HTTP 404

安稳与你 提交于 2019-12-20 05:10:05
问题 I am trying to post a blob to the GitHub API in JavaScript / jQuery as per the docs https://developer.github.com/v3/git/blobs/#create-a-blob - however I keep receiving a 404 request My current request in JavaScript looks like so: var uploadURL ="https://api.github.com/repos/daniellevass/web-quiz/git/blobs" + accessToken; console.log(uploadURL); $.ajax({ type: "POST", dataType: "jsonp", url: uploadURL, data:{ "content": "my message", "encoding": "utf-8" } }) .done(function( data ) { console

How do I make use of the GitHub API?

依然范特西╮ 提交于 2019-12-20 04:28:15
问题 I am not sure what it means when it tells me to use: GET /repos/:owner/:repo/commits/:sha How can I use that API call to retrieve the information I am looking for? 回答1: GET /repos/:owner/:repo/commits/:sha GET is the HTTP method to use in order to invoke this API endpoint. :owner is the name of the user or organization (eg. octocat is the name of a user ). :repo is the name of a repository owned by the chosen user or organization (eg. the octocat user shares the Spoon-Knife repository) :sha

Select * for Github GraphQL Search

放肆的年华 提交于 2019-12-20 03:38:11
问题 One of the advantage of Github Search v4 (GraphQL) over v3 is that it can selectively pick the fields that we want, instead of always getting them all. However, the problem I'm facing now is how to get certain fields. I tried the online help but it is more convolution to me than helpful. Till now, I'm still unable to find the fields for size, score and open issues for the returned repository(ies). That's why I'm wondering if there is a way to get them all, like Select * in SQL. Thx. 回答1:

Github API sorting search results by the created_at field

泪湿孤枕 提交于 2019-12-20 00:20:11
问题 How can I create a search query sorted by the created_at field? I've tried: https://api.github.com/search/repositories?q=blog&sort=created_at&order=desc and https://api.github.com/search/repositories?q=blog&sort=created&order=desc But I get the same results as this query: https://api.github.com/search/repositories?q=blog 回答1: The sort parameter only takes one of three values: stars , forks or updated : The sort field. One of stars , forks , or updated . Default: results are sorted by best

List of branches a commit appears on

徘徊边缘 提交于 2019-12-19 08:06:24
问题 Using the GitHub API (v3) I'd like to figure out which branches a commit appears on. I didn't find a way to directly query this, either through repo commits or the commit data objects. An alternate solution would be to list all the branches, and compare with their HEAD; I guess the comparison would fail if the commit is not on the given branch. Is this supported via the current API, and I just missed it? If not, do you have a (better) workaround? 回答1: That's not possible directly via the

How to find the new location of a repository after a rename

旧街凉风 提交于 2019-12-19 04:09:44
问题 If a user renames a repository from foo/bar.git to foo/baz.git via GitHub's UI, how can I detect this via the API? Currently, I get a 404 if I call the API like this: GET /repos/foo/bar How can I find the new repository name? 回答1: So GitHub does not expose renames through the API. UPDATE : that is no longer true and this answer is out of date; the API has exposed renames since July 2015. Given the constraints of your question (i.e., just the repository name has changed, not the user

How do we know a pull request is approved or rejected using API in github?

拈花ヽ惹草 提交于 2019-12-19 03:58:37
问题 I would like to know if there is an function in the Github API which would return the status of a pull request whether its accepted or rejected. Does such a function exist? 回答1: You can get a single PR and check it's state and merged properties. If it's merged, then it's accepted . If it's closed and not merged it may be rejected . In fact it may be not rejected but closed by a creator. I'm not sure if it's possible to check if it was closed by another user ( rejected ) or by it's creator (