Skip to content

Commit 7101664

Browse files
committed
Only panic during build in CI
1 parent caacd02 commit 7101664

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gatsby-node.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const {Octokit: CoreOctokit} = require('@octokit/rest')
33
const {throttling} = require('@octokit/plugin-throttling')
44
const {retry} = require('@octokit/plugin-retry')
55

6-
const PROD = process.env.NODE_ENV === 'production'
6+
const CI = !!process.env.CI
77
const REPO_URL = 'https://github.com/npm/documentation'
88
const NWO = new URL(REPO_URL).pathname.slice(1)
99
const REPO_BRANCH = 'main'
@@ -244,7 +244,7 @@ const fetchContributors = async (path, fm, {reporter, octokit}) => {
244244
const noAuth = (await octokit.auth()).type === 'unauthenticated'
245245
if (noAuth) {
246246
const msg = `Cannot fetch contributors without GitHub authentication.`
247-
if (PROD) {
247+
if (CI) {
248248
reporter.panic(msg)
249249
return
250250
}
@@ -288,7 +288,7 @@ const fetchContributors = async (path, fm, {reporter, octokit}) => {
288288
latestCommit,
289289
}
290290
} catch (err) {
291-
reporter[PROD ? 'panic' : 'error'](`Error fetching contributors for ${path}`, err)
291+
reporter[CI ? 'panic' : 'error'](`Error fetching contributors for ${path}`, err)
292292
return
293293
}
294294
}

0 commit comments

Comments
 (0)