Skip to content

Commit 32c8ec3

Browse files
MichaelDeBoeyGatsbyJS Bot
authored and
GatsbyJS Bot
committed
chore(github-actions): Update dependencies (#20864)
1 parent d0dfa96 commit 32c8ec3

File tree

5 files changed

+21
-27
lines changed

5 files changed

+21
-27
lines changed

.github/actions/gatsby-site-showcase-validator/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"main": "index.js",
55
"private": true,
66
"dependencies": {
7-
"chalk": "^2.4.2",
8-
"cheerio": "^1.0.0-rc.2",
9-
"js-yaml": "^3.12.2",
10-
"node-fetch": "^2.3.0"
7+
"chalk": "^3.0.0",
8+
"cheerio": "^1.0.0-rc.3",
9+
"js-yaml": "^3.13.1",
10+
"node-fetch": "^2.6.0"
1111
},
1212
"scripts": {
1313
"start": "node ./index.js"

.github/actions/high-priority-prs/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
"test": "jest"
88
},
99
"dependencies": {
10-
"@slack/web-api": "^5.0.1",
11-
"actions-toolkit": "^2.0.0",
10+
"@slack/web-api": "^5.7.0",
11+
"actions-toolkit": "^2.2.0",
1212
"array-to-sentence": "^2.0.0",
13-
"date-fns": "^1.30.1",
14-
"lodash": "^4.17.14"
13+
"date-fns": "^2.9.0",
14+
"lodash": "^4.17.15"
1515
},
1616
"devDependencies": {
17-
"jest": "^24.8.0"
17+
"jest": "^25.1.0"
1818
}
1919
}

.github/actions/high-priority-prs/src/pr-message.js

+7-13
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const _ = require(`lodash`)
22
const arrayToSentence = require(`array-to-sentence`)
3-
const distanceInWords = require(`date-fns/distance_in_words`)
4-
const parse = require(`date-fns/parse`)
3+
const formatDistance = require(`date-fns/formatDistance`)
4+
const parseISO = require(`date-fns/parseISO`)
55

66
// Format a message for Slack's block kit: https://api.slack.com/tools/block-kit-builder
77
module.exports = (queues, maintainers, now = new Date()) => {
@@ -18,15 +18,9 @@ module.exports = (queues, maintainers, now = new Date()) => {
1818

1919
Object.keys(queues).forEach(key => {
2020
const messages = {
21-
noMaintainers: `[${
22-
queues[key].length
23-
}] *_PRs with no responses from maintainers_*`,
24-
commitsSinceLastComment: `[${
25-
queues[key].length
26-
}] *_PRs with new commits awaiting review_*`,
27-
lonelyPrs: `[${
28-
queues[key].length
29-
}] *_PRs that were updated more than 30 days ago_*`,
21+
noMaintainers: `[${queues[key].length}] *_PRs with no responses from maintainers_*`,
22+
commitsSinceLastComment: `[${queues[key].length}] *_PRs with new commits awaiting review_*`,
23+
lonelyPrs: `[${queues[key].length}] *_PRs that were updated more than 30 days ago_*`,
3024
}
3125

3226
report.push({
@@ -57,8 +51,8 @@ module.exports = (queues, maintainers, now = new Date()) => {
5751
: ""
5852

5953
// console.log({ participated })
60-
const createdAgo = distanceInWords(parse(pr.createdAt), now)
61-
const updatedAgo = distanceInWords(parse(pr.updatedAt), now)
54+
const createdAgo = formatDistance(now, parseISO(pr.createdAt))
55+
const updatedAgo = formatDistance(now, parseISO(pr.updatedAt))
6256
text += `${i + 1 + `. `}*<${pr.url}|${
6357
pr.title
6458
}>* — _created_ ${createdAgo} ago — _updated_ ${updatedAgo} ago ${participatedStr}\n`

.github/actions/high-priority-prs/src/process-data.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ const _ = require(`lodash`)
22
const { WebClient } = require("@slack/web-api")
33
const prMessage = require(`./pr-message`)
44
const { Toolkit } = require("actions-toolkit")
5-
const parse = require("date-fns/parse")
6-
const isBefore = require("date-fns/is_before")
7-
const differenceInDays = require("date-fns/difference_in_days")
5+
const parseISO = require("date-fns/parseISO")
6+
const isBefore = require("date-fns/isBefore")
7+
const differenceInDays = require("date-fns/differenceInDays")
88
const tools = new Toolkit({
99
secrets: [
1010
"PERSONAL_GITHUB_TOKEN",
@@ -203,9 +203,9 @@ const processData = (data, now = new Date()) => {
203203
// lonely PRs - open PRs that haven't been updated for at least 30 days
204204
const DAYS_TO_LONELY = 30
205205
const prIsLonely = pr =>
206-
differenceInDays(now, parse(pr.updatedAt)) > DAYS_TO_LONELY
206+
differenceInDays(now, parseISO(pr.updatedAt)) > DAYS_TO_LONELY
207207
const prsByDate = (a, b) =>
208-
isBefore(parse(a.updatedAt), parse(b.updatedAt)) ? -1 : 1
208+
isBefore(parseISO(a.updatedAt), parseISO(b.updatedAt)) ? -1 : 1
209209
const lonely = prs.nodes.filter(prIsLonely).sort(prsByDate)
210210
queues.lonelyPrs.push(...lonely)
211211

0 commit comments

Comments
 (0)