Skip to content

Instantly share code, notes, and snippets.

@focusaurus
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save focusaurus/c0f447cf41d915f217f4 to your computer and use it in GitHub Desktop.
Save focusaurus/c0f447cf41d915f217f4 to your computer and use it in GitHub Desktop.
node.js script to create a github milestone
#!/usr/bin/env node
var request = require('superagent');
var config = require('config');
var GITHUB_API_URL = 'https://api.github.com';
var MILESTONES = '/repos/owner/project/milestones';
request.post(GITHUB_API_URL + MILESTONES)
.set('Authorization', 'token ' + config.githubToken)
.set('User-Agent', 'focusaurus-create-github-milestone')
.send({title: process.argv[2]}).end(function (error, res) {
console.log(error, res.text);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment