Skip to content

Commit 610d5e6

Browse files
Trottmaclover7
authored andcommitted
update github package to 12.x
This eliminates a "high' (risk? priority? something else?) warning that comes up with `npm audit`. There are still other deps that need updating but this is probably the big one and doing it as incrementally as possible while still eliminating that red "high" warning. PR-URL: nodejs#188 Reviewed-By: Jon Moss <me@jonathanmoss.me>
1 parent fd4fe73 commit 610d5e6

File tree

8 files changed

+8425
-237
lines changed

8 files changed

+8425
-237
lines changed

lib/node-repo.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function resolveLabelsThenUpdatePr (options) {
3030
return options.logger.error(err, 'Error retrieving files from GitHub')
3131
}
3232

33-
const filepathsChanged = res.map((fileMeta) => fileMeta.filename)
33+
const filepathsChanged = res.data.map((fileMeta) => fileMeta.filename)
3434
const resolvedLabels = resolveLabels(filepathsChanged, options.baseBranch)
3535

3636
fetchExistingThenUpdatePr(options, resolvedLabels)
@@ -111,6 +111,7 @@ function fetchExistingLabels (options, cb) {
111111
return cb(err)
112112
}
113113

114+
existingLabels = existingLabels.data || existingLabels || []
114115
const existingLabelNames = existingLabels.map((label) => label.name)
115116

116117
// cache labels so we don't have to fetch these *all the time*
@@ -129,11 +130,12 @@ function fetchLabelPages (options, startPageNum, cb) {
129130
repo: options.repo,
130131
page: startPageNum,
131132
per_page: 100
132-
}, (err, existingLabels) => {
133+
}, (err, res) => {
134+
const existingLabels = res.data || []
133135
if (err) {
134136
return cb(err)
135137
}
136-
if (!githubClient.hasNextPage(existingLabels)) {
138+
if (!githubClient.hasNextPage(res)) {
137139
return cb(null, existingLabels)
138140
}
139141
fetchLabelPages(

lib/push-jenkins-update.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,13 @@ function findLatestCommitInPr (options, cb, pageNumber = 1) {
6868
number: options.pr,
6969
page: pageNumber,
7070
per_page: 100
71-
}, (err, commitMetas) => {
71+
}, (err, res) => {
72+
const commitMetas = res.data || []
7273
if (err) {
7374
return cb(err)
7475
}
7576

76-
const lastPageURL = githubClient.hasLastPage(commitMetas)
77+
const lastPageURL = githubClient.hasLastPage(res)
7778
if (lastPageURL) {
7879
return findLatestCommitInPr(options, cb, pageNumberFromURL(lastPageURL))
7980
}

0 commit comments

Comments
 (0)