From 33fca9dd3c893c441a094a04d48ba54e4301bdcd Mon Sep 17 00:00:00 2001 From: Josh Curtiss Date: Thu, 25 Aug 2022 17:28:07 -0500 Subject: [PATCH 1/2] feat: Add acknowledgment for a release that has no changelog entries In the event that no changelog entries are found for a release, we add a line acknowledging this, so that there is content associated with the changelog header for this version. This phenomenon can happen since a release may be made that consists of commits that are not included as changelog entries, like `build`, `chore`, or `docs`. Previously, the release process would abort if there were no changelog entries. This change allows us to still update the changelog with the version release when only internal/documentation commits make up the release. --- scripts/release.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/scripts/release.js b/scripts/release.js index d29e986..9b8e6ae 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -101,9 +101,10 @@ function createChangelogAdditions(opts) { changelogStream.on('end', () => { // In the event the there are no entries added to the changelog (i.e. it's just a - // changelog header), we don't want to add anything to the changelog + // changelog header), we add a line acknowledging this release only contains + // documentation or internal changes. if (content.trim().split('\n').length === 1) { - resolve(undefined); + content += '_This release only contains documentation or internal changes._\n\n'; } resolve(content); @@ -228,11 +229,7 @@ const main = async (argv) => { }); if (!changelogAdditions) { - console.warn(chalk.yellow( - 'There were no changelog entries generated. Aborting changelog preparation.' - + ' If this is expected (e.g. only documentation or internal changes were made),' - + ' this version can be finalized without an update to the changelog.' - )); + console.warn(chalk.yellow('There were no changelog entries generated. Aborting changelog preparation.')); return; } From 274af05520878d8fdd953d4b4e82d698abd62fdf Mon Sep 17 00:00:00 2001 From: Josh Curtiss Date: Thu, 25 Aug 2022 17:49:31 -0500 Subject: [PATCH 2/2] docs: Remove instructions for when no changelog entries are generated Since a changelog will always be created even when no applicable changelog entries are generated, the bullet point for this scenario can be removed. --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index c825fa6..02515a2 100644 --- a/README.md +++ b/README.md @@ -193,8 +193,6 @@ At a high-level, the process for releasing a new version of a package is: 1. Run `npm run release:prep-changelog`. You should now be on a branch named `changelog-v${NEW_VERSION}` containing the automatically generated changelog additions. - * If you receive the message "There were no changelog entries generated" and this is - expected, please proceed to [Perform the Version Bump](#perform-the-version-bump). * If the changelog needs to be edited, please make the needed adjustments and amend your edits to the "chore: update changelog" commit. * When preparing the changelog for a final version, the release candidate changelog