github-api

How to upload github asset file using CURL

青春壹個敷衍的年華 提交于 2019-12-06 06:33:35
I want to upload a file on my desktop called 'hello.txt' to my git repository which has a release. How do I do this? I read the git documentation but it says something like : POST https://<upload_url>/repos/:owner/:repo/releases/:id/assets?name . How to do this in CURL. I did not understand this. How to post this file as a release asset to my github release? Thanks curl -H "Authorization: token $GITHUB_TOKEN" -H "Content-Type: $(file -b --mime-type $FILE)" --data-binary @$FILE "https://uploads.github.com/repos/hubot/singularity/releases/123/assets?name=$(basename $FILE)" https://developer

github api to compare commits, response status is diverged

笑着哭i 提交于 2019-12-06 06:32:11
When configuring jenkins, I want to detect feature branches whether they have merging conflicts, so I use github api v3 to test on 2 intentional conflicted branches. After merge branch1 to master, I compared branch2(b2) like this: curl -i https://api.github.com/repos/hao1987/myself/compare/hao1987:master...hao1987:b2 and it returns a long json which has an attribute: "status": "diverged" I wonder if that means conflict, and where I can try types of "status" This isn't documented (sorry!), but status can be one of four things: "diverged" = commits were introduced on both the head and base

GitHub API - List of Languages

大兔子大兔子 提交于 2019-12-06 05:18:30
Is there an endpoint in the GitHub API that will provide me with a list of ALL the languages on GitHub? I'm looking for similar results to the Languages drop-down in the "Trending" section on the github.com website. VonC Not from GitHub API directly. The OP AgileAce adds in the comments : I've discovered that there is a Linguist library maintained by GitHub. In this repo, there is a YAML file ( lib/linguist/languages.yml ) containing all the languages, and related info. I'm just going to write a script that will parse this file. I mentioned the linguist library in " How does github figure out

Retrieve private repository commits from github

自古美人都是妖i 提交于 2019-12-06 04:00:37
问题 I need to retrieve all commits from Private repositories on github. I already tried with with github API documentation. It provides the API for retrieving the public repository commits. https://api.github.com/repos/:owner/:repo/commits Anybody can help me for taking all commits from private repositories? 回答1: A private repository means you need to authenticate in order to execute your query (here getting the commits). This should work, if you own the private repo: curl -u 'username:password'

How to create Github Pull Request using curl?

我们两清 提交于 2019-12-06 02:31:23
问题 I am trying to create a Github Pull Request using curl (in a bash script) and authenticating using token. I am getting response for curl -u my-user:token https://api.github.com/user . I am getting response for curl https://api.github.com/repos/repo-owner/repo-name/pulls But when I try to create a pull request using the following curl command, I am getting errors: curl -d '{"title":"testPR","base":"master", "head":"user-repo:master"}' https://api.github.com/repos/repo-owner/repo-name/pulls {

How can I send a GraphQL AJAX query with a variable?

送分小仙女□ 提交于 2019-12-06 02:21:23
I am trying to make an API call to GitHub using GraphQL, I have been able to successfully call data with a static graphQL call, however I am having trouble putting a variable (var entry) in my call so that I can change the call based on an input a user would provide in the web app. I am using AJAX to be able to pass the authorization token. Additionally, the call does not work unless the query is JSON stringified (gets 400 error otherwise). The JSON Stringify seems to turn the name of the variable 'superQuery' into a string rather than turning the value of 'superQuery' into a string. How can I

Github API Create Issues return 404 Not found

老子叫甜甜 提交于 2019-12-06 02:16:32
问题 I am making a request to the below URL- Post https://api.github.com/repos/kvimal/2048/issues With my Token as a header for authorization. The Curl Request curl -i -X POST https://api.github.com/repos/kvimal/2048/issues -d "{title:'hey'}" -H "Authorization: Bearer xxxxxxxxxxxxxxxxxx" -H "Content-Type: application/json" And GitHub sends a response 404 Not found. I have reade the Documentation and as far as i have observed i am doing it by the github standards. Can anyone Help with this issues?

What is the correct redirect URL for chrome.identity.launchWebAuthFlow?

ぃ、小莉子 提交于 2019-12-05 22:58:30
问题 I'd like to use the chrome.identity API in a chrome packaged app to allow the user to authenticate with github. From the app side, I'm happy with: chrome.identity.launchWebAuthFlow( {'url':'https://github.com/login/oauth/authorize?client_id=clientidgoeshere','interactive':true}, functionToTakeRedirectURL ); But I'm unsure what the redirect URL should be on the github side. When the app is live, I'll set the redirect url to https://appidgoeshere.chromiumapp.org on the github application page,

Github API: Fetch issues with exceeds rate limit prematurely

99封情书 提交于 2019-12-05 18:42:55
I am building an app that fetches the issues and pull requests of over 1K github repos, like this. $ curl -i "https://api.github.com/repos/user/repo/issues?state=closed" My problem is that, after the initial 60 iterations I get a rate limit error: { "message": "API rate limit exceeded for xxx.xxx.xxx.xxx. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)", "documentation_url": "https://developer.github.com/v3/#rate-limiting" } The document says I can make upto 5000 requests using Authentication Which I registered an oauth

Github API - find out who closed a pull request [closed]

孤者浪人 提交于 2019-12-05 15:13:38
How do I find out who closed a pull request using the Github API? e.g. this pull request was opened by myakura, closed by markdotto. But https://api.github.com/repos/twitter/bootstrap/pulls/4461 doesn't show any reference to markdotto. 来源: https://stackoverflow.com/questions/12033171/github-api-find-out-who-closed-a-pull-request