github-api

Getting access token from Github

岁酱吖の 提交于 2019-12-08 03:58:27
问题 I'm trying to get an access token from Github using a NodeJS client. const axios = require("axios"); var jwt = require("jsonwebtoken"); exports.openedPOST = function openedPOST(req, res) { // generate jwt const now = Math.round(Date.now() / 1000); const payload = { // issued at time iat: now, // expires in 10min exp: now + 600, // Github app id iss: 6700 }; const token = jwt.sign(payload, cert, { algorithm: "RS256" }); console.log(token) // auth to github axios({ method: "get", url: "https:/

Can I get the diff data for one file between two commits via the GH API?

ε祈祈猫儿з 提交于 2019-12-08 01:17:59
问题 I know how to get the commit for a file via the API, along with the SHA and all that nice stuff. But, suppose I just want the diff of a file in 1 commit or the diff of the same file across two commits. For instance, in this commit, say I wanted just the , :counter_sql in the activerecord/lib/active_record/associations.rb . How do I get at that diff data via the API? I am using Octokit.rb. Edit 1 It seems that this is possible per this blog post, but I am just not sure how to do it with

Why does Github API only returns the first 100 watched repositories?

筅森魡賤 提交于 2019-12-08 00:53:50
问题 I'm watching 392 repositories on Github. However, the Github API only returns 100. Does anyone have any idea why? https://github.com/api/v2/json/repos/watched/trivektor 回答1: You need to paginate manually using the page parameter. The HTTP Response headers will tell you the next and the last page, if available. Check the headers: X-Next X-Last Examples: curl -D- https://github.com/api/v2/json/repos/watched/trivektor HTTP/1.1 200 OK Server: nginx/1.0.4 Date: Sat, 22 Oct 2011 08:24:45 GMT

How to get all fork sources from one GitHub repo list operation?

十年热恋 提交于 2019-12-07 23:06:42
问题 I want to get all the source repos for a GitHub user's repos. I have to do it by two steps. For example, first, I can use https://api.github.com/users/nmap/repos to get all repos of user nmap . But the source and parent do not exist. Only when I call https://api.github.com/repos/nmap/:repo_name for each repo, I can get the source and parent : { "id": 63894766, "name": "libpcap", "full_name": "nmap/libpcap", "owner": { "login": "nmap", "id": 63385, "avatar_url": "https://avatars3

Github GraphQL Search with Filtering

那年仲夏 提交于 2019-12-07 22:56:50
问题 Based on my limited searching, it seems GraphQL can only support equal filtering. So, Is it possible to do Github GraphQL searching with the filtering conditions of, stars > 10 forks > 3 total commit >= 5 total issues >= 1 open issues <= 60 size > 2k score > 5 last update is within a year I.e., filtering will all above conditions. Is it possible? 回答1: When querying for repositories, you can apply a filter only for a certain number of the fields in your list: number of stars number of forks

Why is retrofit reordering my QueryMap params?

笑着哭i 提交于 2019-12-07 22:32:18
问题 I'm trying to query the github api like so... https://api.github.com/search/repositories?q=created:>=2015-07-11&sort=stars&order=desc&perpage=25&page=1 Here is my GET @GET("/search") public void getTrending(@QueryMap Map<String,String> filters,Callback<GitResponse> response); Here is how I setup my query Map... Map<String,String> searchFilters = new HashMap<>(); searchFilters.put("created>","2015-07-11"); searchFilters.put("sort","stars"); searchFilters.put("order","desc"); searchFilters.put(

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

时光怂恿深爱的人放手 提交于 2019-12-07 14:14:21
问题 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

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

半城伤御伤魂 提交于 2019-12-07 08:30:55
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . 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

Creating a GitHub hook for when a pull requested is opened

心不动则不痛 提交于 2019-12-07 01:51:25
I'm trying to setup a GitHub hook which sends a POST to a url when a pull request is opened. This post should contain all the relevant details of the pull request, however I have added a url to the "Web-Hook URLS" on GitHub and tested that with request bin and found that it only sends a POST when I do git commit. Is it possible to get GitHub to send a POST when I open a new pull request? Thanks in advance! Resolved by using this gist : https://gist.github.com/bjhess/2726012 来源: https://stackoverflow.com/questions/15383790/creating-a-github-hook-for-when-a-pull-requested-is-opened

Getting access token from Github

天涯浪子 提交于 2019-12-07 00:35:31
I'm trying to get an access token from Github using a NodeJS client. const axios = require("axios"); var jwt = require("jsonwebtoken"); exports.openedPOST = function openedPOST(req, res) { // generate jwt const now = Math.round(Date.now() / 1000); const payload = { // issued at time iat: now, // expires in 10min exp: now + 600, // Github app id iss: 6700 }; const token = jwt.sign(payload, cert, { algorithm: "RS256" }); console.log(token) // auth to github axios({ method: "get", url: "https://api.github.com/app", headers: { Accept: "application/vnd.github.machine-man-preview+json",