diff --git a/packages/conventional-github-releaser/README.md b/packages/conventional-github-releaser/README.md index 7f6c30f3..9b31f0e6 100644 --- a/packages/conventional-github-releaser/README.md +++ b/packages/conventional-github-releaser/README.md @@ -129,6 +129,12 @@ Default: `1` How many releases of changelog you want to generate. It counts from the latest semver tag. Useful when you forgot to generate any previous releases. Set to `0` to regenerate all. +#### discussion + +Default: unset + +The discussion category name, which when given, will have GitHub automatically create a discussion in this category from the release. + ##### name Default: same as version tag diff --git a/packages/conventional-github-releaser/src/cli.js b/packages/conventional-github-releaser/src/cli.js old mode 100644 new mode 100755 index ea15f54b..3ea75bf2 --- a/packages/conventional-github-releaser/src/cli.js +++ b/packages/conventional-github-releaser/src/cli.js @@ -28,6 +28,9 @@ const cli = meow({ If 0, the whole changelog will be regenerated and the outfile will be overwritten Default: 1 + -d, --discussion The discussion category name, which when given, will have GitHub automatically create a discussion in this category from the release. + Default: not set + -v, --verbose Verbose output. Use this for debugging Default: false @@ -63,6 +66,10 @@ const cli = meow({ default: 1, type: 'number' }, + discussion: { + alias: 'd', + type: 'string' + }, verbose: { alias: 'v', default: false, @@ -123,6 +130,7 @@ const changelogOpts = { path: flags.pkg }, releaseCount: flags.releaseCount, + discussion: flags.discussion, draft: flags.draft } diff --git a/packages/conventional-github-releaser/src/index.js b/packages/conventional-github-releaser/src/index.js index c62bad74..a875aca0 100644 --- a/packages/conventional-github-releaser/src/index.js +++ b/packages/conventional-github-releaser/src/index.js @@ -85,6 +85,9 @@ function conventionalGithubReleaser (auth, changelogOpts, context, gitRawCommits target_commitish: changelogOpts.targetCommitish } } + if (changelogOpts.discussion) { + options.body.discussion_category_name = changelogOpts.discussion + } debug(`posting %o to the following URL - ${url}`, options) // Set auth after debug output so that we don't print auth token to console.