diff --git a/Makefile b/Makefile index 153405a18f..87c6e3253c 100644 --- a/Makefile +++ b/Makefile @@ -94,11 +94,7 @@ $(BINARY_OUTPUT_FOLDER)/release.json: # :(exclude) syntax: https://git-scm.com/docs/gitglossary.html#Documentation/gitglossary.txt-exclude # Release notes uses version from package.json so we need to prepack beforehand. $(BINARY_OUTPUT_FOLDER)/RELEASE_NOTES.md: prepack | $(BINARY_RELEASES_FOLDER_TS_CLI) - npx conventional-changelog-cli -p angular -l -r 1 > $(BINARY_OUTPUT_FOLDER)/RELEASE_NOTES.md - - # if the releease notes are generated locally, the version contains something like X.Y.Z-dev.hash - # the replacement below ensures that the version in the RELEASE_NOTES.md is X.Y.Z - sed -i -e "s/$(shell cat $(BINARY_OUTPUT_FOLDER)/version)/$(shell npx semver --coerce $(shell cat $(BINARY_OUTPUT_FOLDER)/version))/g" $(BINARY_OUTPUT_FOLDER)/RELEASE_NOTES.md + npx conventional-changelog-cli -l -r 1 -n ./release-scripts/conventional-changelog-cli-config.js > $(BINARY_OUTPUT_FOLDER)/RELEASE_NOTES.md # Generates a shasum of a target with the same name. # See "Automatic Variables" in GNU Make docs (linked at the top) diff --git a/check-dependencies.config.ts b/check-dependencies.config.ts index ed05874e80..7d4875ddae 100644 --- a/check-dependencies.config.ts +++ b/check-dependencies.config.ts @@ -12,6 +12,7 @@ export const config: Options = { 'ts-node', // used for various scripts to avoid separate compile step 'jest-junit', // used for CI test reporting '@types/node', // node types used for alerts + 'conventional-changelog-conventionalcommits', // used to configure generating release notes ], ignoreDirs: ['node_modules', 'dist', 'fixtures', 'test-output'], }; diff --git a/release-scripts/conventional-changelog-cli-config.js b/release-scripts/conventional-changelog-cli-config.js new file mode 100644 index 0000000000..c37815bec6 --- /dev/null +++ b/release-scripts/conventional-changelog-cli-config.js @@ -0,0 +1,10 @@ +'use strict'; +const config = require('conventional-changelog-conventionalcommits'); + +const headerExtension = ` +The Snyk CLI is being deployed to different deployment channels, users can select the stability level according to their needs. For details please see [this documentation](https://docs.snyk.io/snyk-cli/releases-and-channels-for-the-snyk-cli)`; + +module.exports = config({}).then((preset) => { + preset.conventionalChangelog.writerOpts.headerPartial += headerExtension; + return preset; +}); diff --git a/release-scripts/prepare-release.sh b/release-scripts/prepare-release.sh index 18cfab7569..9e5aa87621 100755 --- a/release-scripts/prepare-release.sh +++ b/release-scripts/prepare-release.sh @@ -24,6 +24,10 @@ fi # Generate the release notes baseline from the commits make binary-releases/RELEASE_NOTES.md clean-package-files format +# if the release notes are generated locally, the version contains something like X.Y.Z-dev.hash +# the replacement below ensures that the version in the RELEASE_NOTES.md is X.Y.Z +sed -i "version" -e "s/$(cat binary-releases/version)/$(npx semver --coerce $(cat binary-releases/version))/g" binary-releases/RELEASE_NOTES.md + # Commit and push the release notes git add -f binary-releases/RELEASE_NOTES.md git commit -m "docs: update release notes"