github-api

Programmatically enable Github Pages for a repository

两盒软妹~` 提交于 2019-12-05 13:15:51
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. 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 commit" git push -u origin master Project-Page: git clone https://github.com/user/repository.git cd

Posting images to Gists via the HTTP API

此生再无相见时 提交于 2019-12-05 07:05:47
Is it possible to post binary files (such as images) to GitHub gists via the HTTP api? In particular, the Gist api docs describe how to post files with string contents. There are two problems here for uploading images. One is that the api has something like a 64kb limit on POST requests (although this is not documented), which is pretty small for image files. Second, it's not obvious what encoding should be used on the wire for image files. It's easy to do this by cloning the git repository associated with the Gist, adding the file, and pushing to the repository, but that requires git and I'd

How to use GET to fetch list of repositories?

无人久伴 提交于 2019-12-05 06:57:26
问题 I am not able to understand how the below thing works: I run the " GET /orgs/octokit/repos " command in the terminal and nothing happens. It's supposed to get list of repositories. I am sure I am not doing the correct way. Can somebody please explain why this command doesn't work? Example: When you get a list of repositories, you get the summary representation of each repository. Here, we fetch the list of repositories owned by the octokit organization: GET /orgs/octokit/repos 回答1: GET is

Using GitHub API to retrieve all versions of a specific file

烂漫一生 提交于 2019-12-05 04:34:00
I am currently trying to read through the (GitHub API)[http://developer.github.com/v3/repos/contents/] to figure out how I can programmatically retrieve all versions of a specific file in a single repository. I see that one can get the list of commits, and the current version of a single file easily. But, is there a way to list all the commits relevant for a specific file and then iterate through all the versions of that file? To get the list of commits relevant for a specific file, use this API endpoint and specify the path parameter: GET https://api.github.com/repos/:owner/:repo/commits?path

List all Java repositories on github using api

空扰寡人 提交于 2019-12-05 02:15:15
问题 I am trying to get a list of all github repositories for a specific language (e.g. Java), without narrowing the search by any specific keyword. Preferably, I want to do this directly from curl, no scripting. The problem is that I've tried formatting the API URL and didn't manage to find the right one, that includes the language=Java parameter but no keyword. For example, the following URL seems to query for repos with the keywords "language" or "java" in their description, including some

How do i get the list of Reviewers for a pull request using Github api?

半世苍凉 提交于 2019-12-05 01:27:27
I need the list of reviewers for a PR, and the Review Requests API present in Github only provides me the requested reviewers which becomes empty once the reviewers have accepted their invitations. I also tried the Reviews API to get all reviews and then get unique users, but that seems to be only for users who enter one and not for those who have accepted the request review invitation and never posted a review. Just went through this problem with the following solution. According to GitHub's documentation : GET /repos/:owner/:repo/pulls/:pull_number/requested_reviewers Pull request authors

How to check mergeability of a branches using the github api

老子叫甜甜 提交于 2019-12-05 01:25:31
I'm trying to check if branch can be merged to another using the github API. There is a property mergeable in GET /repos/:owner/:repo/pulls/:number , but I don't actually want to create a pull request before I know that branches can be merged w/o conflicts. On the github website, when creating a pull request, there is a call to this address which doesn't seem to be an API method (it returns HTML saying whether branches can be merged or not). But still I could use this call, the problem is I have no clue what '1373893022922' refers to. I'd suggest it's somehow connected to the base branch

How can I programmatically detect inactive branches in GitHub repositories?

女生的网名这么多〃 提交于 2019-12-05 00:26:50
问题 I have a dozen repositories in the GitHub repository. The repository structure looks like below: + project1 +------- trunk +------- tags +------- branches + ------- releases + project2 .... Our policy requires any active branch to be deleted after 30 days of inactivity. However, there is no automatic way of detecting such an inactive branch. Occasionally, I have some inactive branch that survive past the 30-day mark. Is there a script to list branches, as well as their last commit date in all

Create an issue with image via GitHub API

混江龙づ霸主 提交于 2019-12-04 22:54:00
I am creating issues with https://developer.github.com/v3/issues/#create-an-issue . Is it possible to attach images to message body? I tried 'Accept', 'application/vnd.github.v3.html+json' and emmbeded the image as img elment base64 encoded. The image will not show, but the ticket editor shows the img element. There is no simple solution to this. The official docs say nothing about that which means it's not supported. The GitHub.com authentication works based on cookies while the API authentication uses tokens/passwords. That means if you really want to hack the things to upload your image

GITHub API Issue with file upload

拟墨画扇 提交于 2019-12-04 20:52:56
问题 I am trying to upload file to GitHub via GITHub API (http://developer.github.com/v3/repos/contents/). Somehow I am not able to upload file. When I tried to upload existing file it gave me message "{\"message\":\"refs/heads/master expected to be at ee1cd720841a4b5b06a8339c333c56b1748e66f9\",\"documentation_url\":\"http://developer.github.com/v3/repos/contents/\"}". When I went to github and tried to delete file using website it gave me below error. I can do workaround with reset head to