github-api

How to get all commits in a Git tag through GitHub API

强颜欢笑 提交于 2020-05-27 04:11:44
问题 I have to fetch all new commits that were a part when a new tag was created on a Git repo. This needs to be done through GitHub API. For example the Git UI says Tagging Tag1 and has a sha associated with it... let's say the sha is : SHA1 Now how do I get all commits which happened or were a part of Tag1 through GitHub API? I want to store all these commits and perform some analysis on them. 回答1: Based on the clarification on your comment: I want to get all commits between this newly created

Have a unique check-run for github actions workflow

牧云@^-^@ 提交于 2020-05-26 12:26:33
问题 I'm trying to enforce labelling PR's using enforce-label-action. name: Enforce PR label on: pull_request: types: [labeled, unlabeled, opened, edited] jobs: enforce-label: runs-on: ubuntu-latest steps: - uses: yogevbd/enforce-label-action@master with: REQUIRED_LABELS_ANY: "bug,enhancement,feature" The problem is that each time PR is labeled, a new check-run getting created and the old one's still having a failing status which cause the check-suite to show: Some checks were not successful . Is

GitHub API (v3): Order tags by creation date

帅比萌擦擦* 提交于 2020-05-25 04:22:44
问题 I ran into a problem / question while using the GitHub API. I need a list of all tags created after a single tag. The only way to do this, is to compare the tags by date. However, the results from the API aren't ordered by date: Result from the API (rails repository example): Results from the webinterface: What i did expect is a list ordered by date. However, as you can see in the pictures: the API is returning v4.0.0rc1 & v4.0.0rc2 before the release of v4.0.0, while 4.0.0 is released after

How to recover lost commits without using git reflog?

爷,独闯天下 提交于 2020-05-16 22:33:46
问题 By somehow I accidentally forcefully pushed a branch and I didn't pull commits that only existed in remote. Usually, when this happens it can be recovered with the git reflog command but this time the lost commits were only in the remote repo. How I can recover those commits that only existed in the GitHub repository? 回答1: It can be done with a few steps with the GitHub API: Go to this URL: https://api.github.com/repos/<user>/<repo>/events This will return/show a JSON object where you can

How can I save a valid image to Github using their API?

南楼画角 提交于 2020-05-14 02:20:46
问题 I'm building a script that uploads an image to GitHub as a base64 string. But my image isn't showing up as an image in Github when I go to view the commit. As I am making a big data submission to upload other files (Markdown), I can't use req.files so I'm sending the image via req.body.imageTest (at least in Postman). I'm building the image string from one of the links below. Can anyone tell: What encoding are images served on GitHub web view? What encoding should I use to send my image to

How is codeload.github.com different to api.github.com?

雨燕双飞 提交于 2020-05-12 04:38:07
问题 I was browsing the next.js repository and noticed this function that downloads and extracts a template from GitHub, with tar: export async function downloadAndExtractExample( root: string, name: string ): Promise<void> { return await promisePipe( got.stream('https://codeload.github.com/zeit/next.js/tar.gz/canary'), tar.extract({ cwd: root, strip: 3 }, [`next.js-canary/examples/${name}`]) ) } I searched on StackOverflow and I only found this: GitHub Api download zip or tarball link That's a

Create folder using GitHub API

隐身守侯 提交于 2020-04-10 07:13:07
问题 Is there any way to create a new folder in git repository using their API? Is it possible to do this with Trees API? 回答1: Yes, but you'd need to create a file in the directory because git only tracks directories with files in them. Example: Say we have a user called "foo" who has a repo called "bar". The repo has the following contents: ├── LICENSE ├── main.go ├── main_test.go └── README.md If we want to create a file in the examples directory called example.go , we would issue the following

Create folder using GitHub API

怎甘沉沦 提交于 2020-04-10 07:13:06
问题 Is there any way to create a new folder in git repository using their API? Is it possible to do this with Trees API? 回答1: Yes, but you'd need to create a file in the directory because git only tracks directories with files in them. Example: Say we have a user called "foo" who has a repo called "bar". The repo has the following contents: ├── LICENSE ├── main.go ├── main_test.go └── README.md If we want to create a file in the examples directory called example.go , we would issue the following

java api to get a file content for enterprise github

☆樱花仙子☆ 提交于 2020-03-19 03:46:55
问题 I tried so hard for a simple line of code that read a file content from enterprise github with oauth token, but could not find a example of such. I tried https://github.com/jcabi/jcabi-github, but it does not support enterprise github?(maybe I am wrong) Now i am trying egit: GitHubClient client = new GitHubClient("enterprise url"); GitHubRequest request = new GitHubRequest(); request.setUri("/readme"); GitHubResponse response = client.get(request); Then what? I only saw a getBody, maybe I

java api to get a file content for enterprise github

别等时光非礼了梦想. 提交于 2020-03-19 03:46:52
问题 I tried so hard for a simple line of code that read a file content from enterprise github with oauth token, but could not find a example of such. I tried https://github.com/jcabi/jcabi-github, but it does not support enterprise github?(maybe I am wrong) Now i am trying egit: GitHubClient client = new GitHubClient("enterprise url"); GitHubRequest request = new GitHubRequest(); request.setUri("/readme"); GitHubResponse response = client.get(request); Then what? I only saw a getBody, maybe I