github-api

Programmatically enable Github Pages for a repository

自作多情 提交于 2019-12-22 08:51:19
问题 Is there any way to enable Github pages through the api? Not requesting a page build, I mean the initial enabling of the feature and pointing to a branch. 回答1: You just have to push content to the remote git repository. You have to differentiate between a User-Page (username.github.io) and a Project-Page (username.github.io/projectname) User-Page: git clone https://github.com/username/username.github.io cd username.github.io echo "Hello World" > index.html git add --all git commit -m "Initial

Github API: Fetch issues with exceeds rate limit prematurely

匆匆过客 提交于 2019-12-22 08:08:56
问题 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

What is the best way to get all commits for many users/organizations using the GitHub API?

耗尽温柔 提交于 2019-12-22 00:13:36
问题 I am trying to get the commit activity for all the repositories from a user or organization using the GitHub API. Currently the way I am solving the issue is: List all the repos for a giving user (https://developer.github.com/v3/repos/#list-user-repositories) For each repo, get the commit activity by calling the commit activity (https://developer.github.com/v3/repos/statistics/#get-the-last-year-of-commit-activity-data) The problem I run into is that using this method, I quickly run to the

Efficiently retrieving stats for all GitHub Commits

那年仲夏 提交于 2019-12-21 17:50:10
问题 Is there a more efficient way of getting the count of additions/deletions related to a commit than looping through every single commit and calling the: GET /repos/:owner/:repo/commits/:sha (https://developer.github.com/v3/repos/commits/) Just to get the: "stats": { "additions": 104, "deletions": 4, "total": 108 }, Data? Unfortunately the commits endpoint: GET /repos/:owner/:repo/commits Contains a lot of data about each commit but not this detail which means a huge number of additional API

Clientside GitHub Authentication

拥有回忆 提交于 2019-12-21 16:59:19
问题 I'm using a Javascript to do Basic Authentication with GitHub. For example, the following shell command gets a token from Github: curl -i -u uaername:password -k -d "{\"scopes\": [\"repo\"]}" https://api.github.com/authorizations How do you achieve that with jQuery and AJAX? 回答1: Including Basic Auth Data in HTTP Headers with jQuery You can include basic auth details in the header using the Authorization field. You already understand how jQuery works. This snippet has the bits you're missing:

Github API is responding with a 403 when using Request's request function

家住魔仙堡 提交于 2019-12-21 12:32:35
问题 I am trying to make a request to github's API. Here is my request: var url = 'https://api.github.com/' + requestUrl + '/' + repo + '/'; request(url, function(err, res, body) { if (!err && res.statusCode == 200) { var link = "https://github.com/" + repo; opener(link); process.exit(); } else { console.log(res.body); console.log(err); console.log('This ' + person + ' does not exist'); process.exit(); } }); This is what I get for my response: Request forbidden by administrative rules. Please make

Cannot upload github release asset through API

感情迁移 提交于 2019-12-21 11:37:13
问题 I have a github release with no assets yet: $ curl https://api.github.com/repos/cljsinfo/api-docs/releases/1260660/assets [ ] But I cannot upload an asset to this release: $ curl -X POST --header "Content-Type:application/edn" --data-binary @cljsdocs-full.edn "https://api.github.com/repos/cljsinfo/api-docs/releases/1260660/assets?name=full.edn&access_token=$(cat my-token)" { "message": "Not Found", "documentation_url": "https://developer.github.com/v3" } my api access token has public_repo

Cannot upload github release asset through API

烂漫一生 提交于 2019-12-21 11:36:07
问题 I have a github release with no assets yet: $ curl https://api.github.com/repos/cljsinfo/api-docs/releases/1260660/assets [ ] But I cannot upload an asset to this release: $ curl -X POST --header "Content-Type:application/edn" --data-binary @cljsdocs-full.edn "https://api.github.com/repos/cljsinfo/api-docs/releases/1260660/assets?name=full.edn&access_token=$(cat my-token)" { "message": "Not Found", "documentation_url": "https://developer.github.com/v3" } my api access token has public_repo

GitHub API v3: Determine if user is an Owner of an Organization

♀尐吖头ヾ 提交于 2019-12-21 11:24:12
问题 It's easy to determine if a User is a member of a Team if you know the id: GET /teams/:id/members/:user But how can one easily determine the ID of the special "Owners" team that every Organization has? As far as I can tell, the only way is to retrieve a full list of all Teams (which I assume may be multiple pages?) and walk through them until you find one with the name "Owners". This is doable of course, but it's uncharacteristically inconvenient for GitHub's otherwise fantastic API. ;) For

GitHub v3 API: How to create initial commit for my shiny new repository?

陌路散爱 提交于 2019-12-21 10:24:22
问题 GitHub API docs says: Git DB API functions will return a 409 if the git repo for a Repository is empty or unavailable. My POST on $repo/git/trees returns 409 indeed. How do I create initial commit in the repository then? Do I have to force user to commit some useless junk manually, just for the sake of creating root commit? 回答1: I emailed github support with the same issue and here is their response: From: Rick (GitHub Staff) Subject: Creating an initial commit using the v3 API Currently, you