diff --git a/ghost/release-utils/lib/gist.js b/ghost/release-utils/lib/gist.js index c2d7a0541b..caa575cb5e 100644 --- a/ghost/release-utils/lib/gist.js +++ b/ghost/release-utils/lib/gist.js @@ -11,7 +11,6 @@ module.exports.create = (options = {}) => { 'gistName', 'gistDescription', 'github', - 'github.username', 'github.token', 'userAgent' ); @@ -27,7 +26,7 @@ module.exports.create = (options = {}) => { content: content.toString('utf8') }; - const auth = 'Basic ' + new Buffer(options.github.username + ':' + options.github.token).toString('base64'); + const auth = 'token ' + options.github.token; const reqOptions = { uri: 'https://api.github.com/gists', diff --git a/ghost/release-utils/lib/releases.js b/ghost/release-utils/lib/releases.js index 36d14fdd4c..99a2d9f82b 100644 --- a/ghost/release-utils/lib/releases.js +++ b/ghost/release-utils/lib/releases.js @@ -40,7 +40,6 @@ module.exports.create = (options = {}) => { localUtils.checkMissingOptions(options, 'changelogPath', 'github', - 'github.username', 'github.token', 'userAgent', 'uri', @@ -77,7 +76,7 @@ module.exports.create = (options = {}) => { body.push('You can see the [full change log](' + options.gistUrl + ') for the details of every change included in this release.'); } - const auth = 'Basic ' + new Buffer(options.github.username + ':' + options.github.token).toString('base64'); + const auth = 'token ' + options.github.token; const reqOptions = { uri: options.uri, @@ -112,13 +111,12 @@ module.exports.uploadZip = (options = {}) => { localUtils.checkMissingOptions(options, 'zipPath', 'github', - 'github.username', 'github.token', 'userAgent', 'uri' ); - const auth = 'Basic ' + new Buffer(options.github.username + ':' + options.github.token).toString('base64'); + const auth = 'token ' + options.github.token; const stats = fs.statSync(options.zipPath); const reqOptions = { diff --git a/ghost/release-utils/test/releases.test.js b/ghost/release-utils/test/releases.test.js index 24f70c358f..4df93038e8 100644 --- a/ghost/release-utils/test/releases.test.js +++ b/ghost/release-utils/test/releases.test.js @@ -10,7 +10,7 @@ describe('Releases', function () { try { lib.releases.uploadZip(); } catch (err) { - err.message.should.eql('Missing options: zipPath, github, github.username, github.token, userAgent, uri'); + err.message.should.eql('Missing options: zipPath, github, github.token, userAgent, uri'); return done(); } @@ -19,7 +19,7 @@ describe('Releases', function () { it('missing options', function (done) { try { - lib.releases.uploadZip({zipPath: 'test', github: {username: 'test'}}); + lib.releases.uploadZip({zipPath: 'test', github: {}}); } catch (err) { err.message.should.eql('Missing options: github.token, userAgent, uri'); return done();