github-api

Check if a branch is empty

天大地大妈咪最大 提交于 2021-02-19 08:15:08
问题 Is there a way to check if a branch is empty using the github API? /repos/:owner/:repo/branches/:branch returns the last commit, but how do I check if the commit belongs to the same branch or the parent branch? 回答1: As illustrated in "Find the parent branch of a git branch", a git branch has no "parent branch". A branch can be empty compared to another, and ahead compared to another: --x--x (branch1) \ o--o (branch2, branch3) Here, branch3 could be considered "empty" when compared to branch2

Is it possible to find out, via the GitHub API, if an issue has been closed via a pull request

…衆ロ難τιáo~ 提交于 2021-02-18 18:12:54
问题 I'm using github-script for GitHub actions, which allows you to easily access GitHub API. I'm trying to check if an issue has not been closed by clicking on the "close button", that is, via a commit or via merging a pull request that includes a closing commit (or closes in the PR body). However, there does not seem an easy way to do that. This is the event information the GitHub API returns: If the issue has been closed from a commit, it adds the commit_id If the issue has been closed from

GitHub API to Create a File

北战南征 提交于 2021-02-18 05:21:09
问题 So I'm trying to familiarize myself with the GitHub API. I'm using cURL commands to implement some of their basic functionality. I can get the basic authorization & repository creation correctly. Currently, I'm trying to create a file in a repository using their API & am facing the "message":"Not Found" error as the response. Their documentation suggests this: PUT /repos/:owner/:repo/contents/:path I came up with this as the cURL equivalent: curl -H 'Authorization: <token>' -d '{"path": "test

ERROR event: Not Found; when triggering event from another event : probot app built in nodejs

大城市里の小女人 提交于 2021-02-11 14:13:56
问题 I am building a GitHub app in probot and nodejs and trying to update the PR whenever a pull_request.synchronize event occurs. I know that doesn't make much sense, but the point is I want to be able to update the PR upon the occurrence of a certain event. app.on('pull_request.synchronize', async context => { console.log('---------------------- on pull_request.synchronize, body of PR : ', context.payload.pull_request) console.log('State of PR after pull_request.synchronize event :--------------

Commits stats from github using graphql

╄→гoц情女王★ 提交于 2021-02-08 03:46:25
问题 Can someone tell me - is where are a way to get all commits of specific repository with stats using graphql api? For now i end with query like this: query { viewer { repository(name: "CRM_system") { ref(qualifiedName: "master") { target { ... on Commit { id history(since: my_date_time) { edges { node { messageHeadline oid message author { name email date } } } } } } } } } } But it show commits only from 'master' and doesnt show stats at all, i want to see something similar to github rest api:

GitHub API - How to add an admin collaborator?

这一生的挚爱 提交于 2021-02-07 20:39:14
问题 I'm using the github api (v3) to create a repository in an organisation using my account. I am an admin of that organisation. I'm then using the collaborators endpoint to add a collaborator with admin permissions. I'm authenticating with an oauth token that has the 'repos' scope; PUT /repos/:owner/:repo/collaborators/:username?permission=admin Which returns a 204 leading me to believe the PUT has been successful. However, when I get the repository collaborators, or view the collaborators

GitHub API - How to add an admin collaborator?

被刻印的时光 ゝ 提交于 2021-02-07 20:38:00
问题 I'm using the github api (v3) to create a repository in an organisation using my account. I am an admin of that organisation. I'm then using the collaborators endpoint to add a collaborator with admin permissions. I'm authenticating with an oauth token that has the 'repos' scope; PUT /repos/:owner/:repo/collaborators/:username?permission=admin Which returns a 204 leading me to believe the PUT has been successful. However, when I get the repository collaborators, or view the collaborators

get all commits in a Git tag through GitHub API return only the first commit

半世苍凉 提交于 2021-02-07 17:07:31
问题 I'm trying to get all commits in a git tag throw github api. I checked in this stack overflow issue but in this way, it asks me to compare between two tags and it returns me only the first commit. I want to get all commits of a specific tag. what I used is https://api.github.com/repos/:org/:repo/compare/:tag_1...:tag_2 because I want to specific tag I added the same tag https://api.github.com/repos/RapidAPI/ant-design/compare/3.13.2...3.13.2 it return me the only 2 commits but in the tag I

get all commits in a Git tag through GitHub API return only the first commit

半世苍凉 提交于 2021-02-07 17:05:47
问题 I'm trying to get all commits in a git tag throw github api. I checked in this stack overflow issue but in this way, it asks me to compare between two tags and it returns me only the first commit. I want to get all commits of a specific tag. what I used is https://api.github.com/repos/:org/:repo/compare/:tag_1...:tag_2 because I want to specific tag I added the same tag https://api.github.com/repos/RapidAPI/ant-design/compare/3.13.2...3.13.2 it return me the only 2 commits but in the tag I

Github API: Get number of contributions on a day by day basis

梦想与她 提交于 2021-02-07 16:39:14
问题 I want to GET from the Github API, the number of contributions per day. I'm making a webapp that compares the number of github contributions to the number of Dota 2 matches I play. This picture should explain things more clearly. http://i.stack.imgur.com/cZ1XK.png I have scoured the Github API and the internet looking for a simple solution and some of the answers I've seen weren't what I was looking for. This Github API get last year of commit activity blurb is the closest I've gotten to