github-api

github v3 API - delete / remove a repo

老子叫甜甜 提交于 2019-12-09 07:01:44
问题 I would like to programmatically delete a github repo, when setting up a unit test environment for my application. I am already using the v3 API, which seems to be most supported and the path going forward. I am using the following python lines to successfully CREATE a repo, just fine: import urllib2, base64 createData = '{\"name\": \"UnitTest-SubModules\", \"description\": \"This is a Fake repo used for testing\"}' request = urllib2.Request("https://api.github.com/user/repos") base64string =

get list of git branches for a repo hosted on github

放肆的年华 提交于 2019-12-08 21:55:02
问题 Is there a command line way of getting the list of branches available in a repo hosted in GITHUB (without creating and running commands from within a clone)? I tried using curl on the url that shows the branches list and getting the content. 回答1: git ls-remote --heads <repo-url> Man page of git ls-remote. For example, to git the branches of git's git repo use $git ls-remote --heads git://github.com/git/git.git 121f71f0da1bc9a4e1e96be2c3e683191a82a354 refs/heads/maint

How to create github Repository and upload files from PHP?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-08 19:44:31
I am trying to create GitHub Repository from PHP code, as well as i wanted to upload the files into the created GitHub Repository. I been trying to use https://github.com/ornicar/php-github-api this PHP API , But i couldn't find anywhere that how can i upload Files into the created GitHub Repository. So Please Help me to solve this issue, Thanks in Advance. Ex: I want to create a Respo Named myProject1 Then i wanted to add three files( papi.php, index.php, jquery.min.js ). So please help me. VonC As mentioned in " GitHub API - write to repo ", you would need to create a blob . You can see an

Which permissions are needed for a GitHub app to access list-issues-for-a-repository API?

◇◆丶佛笑我妖孽 提交于 2019-12-08 18:46:34
I'd like to create a GitHub app to display the current issues in a repository, organized by labels. The repositories under the organization are private, but my account has admin access. I've installed the app under my name. The API list-issues-for-a-repository is returning: { "message": "Not Found", "documentation_url": "https://developer.github.com/v3/issues/#list-issues-for-a-repository" } I've set the app permissions as follows: Repository permissions Issues - Read-only Metadata - Read-only No access for everything else Organization permissions No access for all User permissions No access

github apit get commit info related to specific file

 ̄綄美尐妖づ 提交于 2019-12-08 11:44:39
问题 how do I get the most recent commit containing a specific file? I am currently retrieving all the files from a specific directory in my repo like so https://api.github.com/repos/' + this.fullRepoUrl + '/contents' + this.path which returns a series of objects that look like this { "name": "preview-whats-to-come.md", "path": "posts/preview-whats-to-come.md", "sha": "08bf61b7b1a8895cd1415f93f40315f4c5ef8bf9", "size": 1861, "url": "https://api.github.com/repos/user/repo/contents/posts/preview

How to commit files larger than 1mb to GitHub using the GitHub API and Octokit JavaScript

ぃ、小莉子 提交于 2019-12-08 09:14:29
问题 I need to update a file on GitHub from JavaScript running in a client browser application. The file may be larger than 1mb so I cannot use the octokit createFile() function which is limited to files less than 1mb. I have an authenticated user through oauth, a file, and a repository that the file needs to end up in. Basically I have: this.octokit = new Octokit(); this.octokit.authenticate({ type: "oauth", token: github.access_token }) this.file = "some text in a string thing"; this.octokit

Creating a GitHub hook for when a pull requested is opened

余生长醉 提交于 2019-12-08 07:16:37
问题 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! 回答1: Resolved by using this gist : https://gist.github.com/bjhess/2726012 来源: https:/

Which permissions are needed for a GitHub app to access list-issues-for-a-repository API?

一世执手 提交于 2019-12-08 06:37:35
问题 I'd like to create a GitHub app to display the current issues in a repository, organized by labels. The repositories under the organization are private, but my account has admin access. I've installed the app under my name. The API list-issues-for-a-repository is returning: { "message": "Not Found", "documentation_url": "https://developer.github.com/v3/issues/#list-issues-for-a-repository" } I've set the app permissions as follows: Repository permissions Issues - Read-only Metadata - Read

How to create github Repository and upload files from PHP?

纵然是瞬间 提交于 2019-12-08 06:09:14
问题 I am trying to create GitHub Repository from PHP code, as well as i wanted to upload the files into the created GitHub Repository. I been trying to use https://github.com/ornicar/php-github-api this PHP API , But i couldn't find anywhere that how can i upload Files into the created GitHub Repository. So Please Help me to solve this issue, Thanks in Advance. Ex: I want to create a Respo Named myProject1 Then i wanted to add three files( papi.php, index.php, jquery.min.js ). So please help me.

Are we able to use GitHub API to create a commit? especially v4?

浪子不回头ぞ 提交于 2019-12-08 04:48:13
问题 Are we able to use GitHub API to create a commit? Can we use API to upload a file/blob, like what we can do using Git command, especially in API v4? 回答1: Presumably yes, using the GitHub Commits API (in the context of a GitHub application) You can see the all sequence in "GitHub API Git Data": Get the current commit object Retrieve the tree it points to Retrieve the content of the blob object that tree has for that particular file path Change the content somehow and post a new blob object