Skip to content

Commit efef49c

Browse files
committed
chore: skip package without releases?
1 parent 791071f commit efef49c

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

scripts/gatsby-changelog-generator/generate.js

+17-15
Original file line numberDiff line numberDiff line change
@@ -310,21 +310,23 @@ async function onNewVersion() {
310310
.filter(v => isStableVersion(v) || isBranchCutPreminorVersion(v))
311311
.slice(-1)
312312

313-
const entry = await buildChangelogEntry({
314-
pkg: packageName,
315-
version,
316-
fromTag: lastVersion ? `${packageName}@${lastVersion}` : ``,
317-
toTag: `HEAD`,
318-
date: dateFormat(new Date(), `yyyy-mm-dd`),
319-
gatsbyRelease:
320-
gatsbyVersion && gatsbyVersion.patch === 0
321-
? `${gatsbyVersion.major}.${gatsbyVersion.minor}`
322-
: ``,
323-
})
324-
325-
if (entry) {
326-
addChangelogEntries(packageName, entry)
327-
updatedChangelogs.push(changelogRelativePath(packageName))
313+
if (lastVersion) {
314+
const entry = await buildChangelogEntry({
315+
pkg: packageName,
316+
version,
317+
fromTag: lastVersion ? `${packageName}@${lastVersion}` : ``,
318+
toTag: `HEAD`,
319+
date: dateFormat(new Date(), `yyyy-mm-dd`),
320+
gatsbyRelease:
321+
gatsbyVersion && gatsbyVersion.patch === 0
322+
? `${gatsbyVersion.major}.${gatsbyVersion.minor}`
323+
: ``,
324+
})
325+
326+
if (entry) {
327+
addChangelogEntries(packageName, entry)
328+
updatedChangelogs.push(changelogRelativePath(packageName))
329+
}
328330
}
329331
} catch (error) {
330332
console.error(`package "${packageName}": ${error.stack}`)

0 commit comments

Comments
 (0)