Skip to content

Commit

Permalink
Dependency updates to remove critical warnings and fix release process (
Browse files Browse the repository at this point in the history
#3215)

* Updating octokit/rest and lerna

* Updating mocha

* Updating types

* removing the lerna upgrade

* update lerna to the highest version that doesn't break the tests, also fixes the critical dependency error
  • Loading branch information
tropicadri authored May 30, 2023
1 parent 2526444 commit ee44e68
Show file tree
Hide file tree
Showing 8 changed files with 10,654 additions and 13,687 deletions.
1 change: 0 additions & 1 deletion .ncurc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
module.exports = {
reject: [
// See https://github.com/GoogleChrome/workbox/issues/2479
'@octokit/rest',
'service-worker-mock',
],
};
26 changes: 11 additions & 15 deletions gulp-tasks/utils/github-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
https://opensource.org/licenses/MIT.
*/

const GitHubApi = require('@octokit/rest');
const {Octokit} = require('@octokit/rest');
const semver = require('semver');

const constants = require('./constants');

const github = new GitHubApi();

// github.authenticate() is synchronous, and it only stores the credentials for
// the next request, so it should be called once per method that requires auth.
// See https://github.com/mikedeboer/node-github#authentication
Expand All @@ -24,30 +22,28 @@ const authenticate = () => {
);
}

github.authenticate({
type: 'token',
token: process.env.GITHUB_TOKEN,
});
return new Octokit({auth: process.env.GITHUB_TOKEN});
};

module.exports = {
createRelease: (args) => {
authenticate();
const github = authenticate();

args.owner = constants.GITHUB_OWNER;
args.repo = constants.GITHUB_REPO;
return github.repos.createRelease(args);
return github.rest.repos.createRelease(args);
},

uploadAsset: (args) => {
authenticate();
const github = authenticate();
args.owner = constants.GITHUB_OWNER;
args.repo = constants.GITHUB_REPO;
return github.repos.uploadAsset(args);
return github.rest.repos.uploadReleaseAsset(args);
},

getTaggedReleases: async () => {
authenticate();
const releasesData = await github.repos.getReleases({
const github = authenticate();
const releasesData = await github.rest.repos.listReleases({
owner: constants.GITHUB_OWNER,
repo: constants.GITHUB_REPO,
});
Expand All @@ -65,8 +61,8 @@ module.exports = {
},

getTags: async () => {
authenticate();
const tagsResponse = await github.repos.getTags({
const github = authenticate();
const tagsResponse = await github.repos.listTags({
owner: constants.GITHUB_OWNER,
repo: constants.GITHUB_REPO,
});
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"lerna": "3.4.0",
"lerna": "5.6.2",
"packages": ["packages/*"],
"version": "6.6.0"
}
Loading

0 comments on commit ee44e68

Please sign in to comment.