mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
Switched to using token authentication for GitHub
no issue
This commit is contained in:
parent
eb7e7a8f31
commit
ff4d8ef903
@ -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',
|
||||
|
@ -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 = {
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user