Skip to content

Commit

Permalink
fix: strf-8574, bump version of "github" package to fix security issues
Browse files Browse the repository at this point in the history
Node-github was renamed to @octokit/rest
  • Loading branch information
MaxGenash committed Aug 3, 2020
1 parent 9e30b99 commit 1013e3a
Show file tree
Hide file tree
Showing 3 changed files with 276 additions and 175 deletions.
21 changes: 8 additions & 13 deletions lib/release/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const themePath = process.cwd();
const git = require('simple-git')(themePath);
const themeConfig = require('../theme-config').getInstance(themePath);
const questions = require('./questions');
const GitHub = require('github');
const { Octokit } = require('@octokit/rest');
const Bundle = require('../stencil-bundle');

module.exports = () => {
Expand Down Expand Up @@ -128,19 +128,19 @@ function createGithubRelease(commit, version, changelog, remote, bundlePath, cal
github.repos.createRelease(releaseParams)
.then(release => {
const uploadParams = {
id: release.id,
release_id: release.data.id,
owner: remote.owner,
repo: remote.repo,
filePath: bundlePath,
data: bundlePath,
name: `${themeConfig.getName()}-${version}.zip`,
};

console.log('Uploading Bundle File...');

github.repos.uploadAsset(uploadParams)
github.repos.uploadReleaseAsset(uploadParams)
.then(asset => {
console.log(`Release url: ${release.html_url.green}`);
console.log(`Bundle download url: ${asset.browser_download_url.green}`);
console.log(`Release url: ${release.data.html_url.green}`);
console.log(`Bundle download url: ${asset.data.browser_download_url.green}`);

callback();
})
Expand Down Expand Up @@ -260,14 +260,9 @@ function printWarning(message) {
}

function getGithubClient() {
const github = new GitHub();

github.authenticate({
type: 'oauth',
token: getGithubToken(),
return new Octokit({
auth: getGithubToken(),
});

return github;
}

function isReleaseCandidate(version) {
Expand Down
Loading

0 comments on commit 1013e3a

Please sign in to comment.