Skip to content

Commit

Permalink
chore: skip package without releases?
Browse files Browse the repository at this point in the history
  • Loading branch information
pieh committed May 24, 2022
1 parent 791071f commit efef49c
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions scripts/gatsby-changelog-generator/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,21 +310,23 @@ async function onNewVersion() {
.filter(v => isStableVersion(v) || isBranchCutPreminorVersion(v))
.slice(-1)

const entry = await buildChangelogEntry({
pkg: packageName,
version,
fromTag: lastVersion ? `${packageName}@${lastVersion}` : ``,
toTag: `HEAD`,
date: dateFormat(new Date(), `yyyy-mm-dd`),
gatsbyRelease:
gatsbyVersion && gatsbyVersion.patch === 0
? `${gatsbyVersion.major}.${gatsbyVersion.minor}`
: ``,
})

if (entry) {
addChangelogEntries(packageName, entry)
updatedChangelogs.push(changelogRelativePath(packageName))
if (lastVersion) {
const entry = await buildChangelogEntry({
pkg: packageName,
version,
fromTag: lastVersion ? `${packageName}@${lastVersion}` : ``,
toTag: `HEAD`,
date: dateFormat(new Date(), `yyyy-mm-dd`),
gatsbyRelease:
gatsbyVersion && gatsbyVersion.patch === 0
? `${gatsbyVersion.major}.${gatsbyVersion.minor}`
: ``,
})

if (entry) {
addChangelogEntries(packageName, entry)
updatedChangelogs.push(changelogRelativePath(packageName))
}
}
} catch (error) {
console.error(`package "${packageName}": ${error.stack}`)
Expand Down

0 comments on commit efef49c

Please sign in to comment.