Skip to content

Instantly share code, notes, and snippets.

@chipoglesby
Created October 2, 2016 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chipoglesby/d8560717a86011d4e0493c14e00487bb to your computer and use it in GitHub Desktop.
Save chipoglesby/d8560717a86011d4e0493c14e00487bb to your computer and use it in GitHub Desktop.
A Google Apps Script that automatically opens a pull request on a Github Repo.
function github() {
username = "xxx"
repo = "xxx"
url = "https://api.github.com/repos/"+username+"/"+repo+"/issues"
payload = {
"title": "xxx",
"body": "xxx",
"assignee": "xxx"
}
sendToGithub(url, payload)
}
function sendToGithub(url, payload) {
options = {
"method": "post",
"contentType": "application/json",
"payload": JSON.stringify(payload),
"headers": {"authorization": "Basic xxx"}
};
return UrlFetchApp.fetch(url, options)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment