@semantic-release/github
Advanced tools
Comparing version 9.1.0 to 9.2.0
@@ -20,3 +20,3 @@ /* eslint require-atomic-updates: off */ | ||
const { options } = context; | ||
// If the GitHub publish plugin is used and has `assets`, `successComment`, `failComment`, `failTitle`, `labels` or `assignees` configured, validate it now in order to prevent any release if the configuration is wrong | ||
// If the GitHub publish plugin is used and has `assets`, `successComment`, `failComment`, `failTitle`, `labels`, `discussionCategoryName` or `assignees` configured, validate it now in order to prevent any release if the configuration is wrong | ||
if (options.publish) { | ||
@@ -46,2 +46,6 @@ const publishPlugin = | ||
); | ||
pluginConfig.discussionCategoryName = defaultTo( | ||
pluginConfig.discussionCategoryName, | ||
publishPlugin.discussionCategoryName, | ||
); | ||
} | ||
@@ -48,0 +52,0 @@ |
@@ -224,1 +224,14 @@ import { inspect } from "node:util"; | ||
} | ||
export function EINVALIDDISCUSSIONCATEGORYNAME({ discussionCategoryName }) { | ||
return { | ||
message: "Invalid `discussionCategoryName` option.", | ||
details: `The [discussionCategoryName option](${linkify( | ||
"README.md#discussionCategoryName", | ||
)}) if defined, must be a non empty \`String\`. | ||
Your configuration for the \`discussionCategoryName\` option is \`${stringify( | ||
discussionCategoryName, | ||
)}\`.`, | ||
}; | ||
} |
@@ -34,2 +34,3 @@ import { resolve, basename, extname } from "node:path"; | ||
releaseBodyTemplate, | ||
discussionCategoryName, | ||
} = resolveConfig(pluginConfig, context); | ||
@@ -57,2 +58,7 @@ const { owner, repo } = parseGithubUrl(repositoryUrl); | ||
// If discussionCategoryName is not undefined or false | ||
if (discussionCategoryName) { | ||
release.discussion_category_name = discussionCategoryName; | ||
} | ||
const draftReleaseOptions = { ...release, draft: true }; | ||
@@ -59,0 +65,0 @@ |
@@ -19,2 +19,3 @@ import { isNil, castArray } from "lodash-es"; | ||
releaseBodyTemplate, | ||
discussionCategoryName, | ||
}, | ||
@@ -56,3 +57,6 @@ { env }, | ||
: "<%= nextRelease.name %>", | ||
discussionCategoryName: isNil(discussionCategoryName) | ||
? false | ||
: discussionCategoryName, | ||
}; | ||
} |
@@ -50,2 +50,3 @@ import { | ||
releaseNameTemplate: isNonEmptyString, | ||
discussionCategoryName: canBeDisabled(isNonEmptyString), | ||
}; | ||
@@ -52,0 +53,0 @@ |
{ | ||
"name": "@semantic-release/github", | ||
"description": "semantic-release plugin to publish a GitHub release and comment on released Pull Requests/Issues", | ||
"version": "9.1.0", | ||
"version": "9.2.0", | ||
"type": "module", | ||
@@ -6,0 +6,0 @@ "author": "Pierre Vanduynslager (https://twitter.com/@pvdlg_)", |
@@ -82,18 +82,19 @@ # @semantic-release/github | ||
| Option | Description | Default | | ||
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| `githubUrl` | The GitHub Enterprise endpoint. | `GH_URL` or `GITHUB_URL` environment variable. | | ||
| `githubApiPathPrefix` | The GitHub Enterprise API prefix. | `GH_PREFIX` or `GITHUB_PREFIX` environment variable. | | ||
| `proxy` | The proxy to use to access the GitHub API. Set to `false` to disable usage of proxy. See [proxy](#proxy). | `HTTP_PROXY` environment variable. | | ||
| `assets` | An array of files to upload to the release. See [assets](#assets). | - | | ||
| `successComment` | The comment to add to each issue and pull request resolved by the release. Set to `false` to disable commenting on issues and pull requests. See [successComment](#successcomment). | `:tada: This issue has been resolved in version ${nextRelease.version} :tada:\n\nThe release is available on [GitHub release](<github_release_url>)` | | ||
| `failComment` | The content of the issue created when a release fails. Set to `false` to disable opening an issue when a release fails. See [failComment](#failcomment). | Friendly message with links to **semantic-release** documentation and support, with the list of errors that caused the release to fail. | | ||
| `failTitle` | The title of the issue created when a release fails. Set to `false` to disable opening an issue when a release fails. | `The automated release is failing 🚨` | | ||
| `labels` | The [labels](https://help.github.com/articles/about-labels) to add to the issue created when a release fails. Set to `false` to not add any label. | `['semantic-release']` | | ||
| `assignees` | The [assignees](https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users) to add to the issue created when a release fails. | - | | ||
| `releasedLabels` | The [labels](https://help.github.com/articles/about-labels) to add to each issue and pull request resolved by the release. Set to `false` to not add any label. See [releasedLabels](#releasedlabels). | `['released<%= nextRelease.channel ? \` on @\${nextRelease.channel}\` : "" %>']- | | ||
| `addReleases` | Will add release links to the GitHub Release. Can be `false`, `"bottom"` or `"top"`. See [addReleases](#addReleases). | `false` | | ||
| `draftRelease` | A boolean indicating if a GitHub Draft Release should be created instead of publishing an actual GitHub Release. | `false` | | ||
| `releaseNameTemplate` | A [Lodash template](https://lodash.com/docs#template) to customize the github release's name | `<%= nextverison.name %>` | | ||
| `releaseBodyTemplate` | A [Lodash template](https://lodash.com/docs#template) to customize the github release's body | `<%= nextverison.notes %>` | | ||
| Option | Description | Default | | ||
| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| `githubUrl` | The GitHub Enterprise endpoint. | `GH_URL` or `GITHUB_URL` environment variable. | | ||
| `githubApiPathPrefix` | The GitHub Enterprise API prefix. | `GH_PREFIX` or `GITHUB_PREFIX` environment variable. | | ||
| `proxy` | The proxy to use to access the GitHub API. Set to `false` to disable usage of proxy. See [proxy](#proxy). | `HTTP_PROXY` environment variable. | | ||
| `assets` | An array of files to upload to the release. See [assets](#assets). | - | | ||
| `successComment` | The comment to add to each issue and pull request resolved by the release. Set to `false` to disable commenting on issues and pull requests. See [successComment](#successcomment). | `:tada: This issue has been resolved in version ${nextRelease.version} :tada:\n\nThe release is available on [GitHub release](<github_release_url>)` | | ||
| `failComment` | The content of the issue created when a release fails. Set to `false` to disable opening an issue when a release fails. See [failComment](#failcomment). | Friendly message with links to **semantic-release** documentation and support, with the list of errors that caused the release to fail. | | ||
| `failTitle` | The title of the issue created when a release fails. Set to `false` to disable opening an issue when a release fails. | `The automated release is failing 🚨` | | ||
| `labels` | The [labels](https://help.github.com/articles/about-labels) to add to the issue created when a release fails. Set to `false` to not add any label. | `['semantic-release']` | | ||
| `assignees` | The [assignees](https://help.github.com/articles/assigning-issues-and-pull-requests-to-other-github-users) to add to the issue created when a release fails. | - | | ||
| `releasedLabels` | The [labels](https://help.github.com/articles/about-labels) to add to each issue and pull request resolved by the release. Set to `false` to not add any label. See [releasedLabels](#releasedlabels). | `['released<%= nextRelease.channel ? \` on @\${nextRelease.channel}\` : "" %>']- | | ||
| `addReleases` | Will add release links to the GitHub Release. Can be `false`, `"bottom"` or `"top"`. See [addReleases](#addReleases). | `false` | | ||
| `draftRelease` | A boolean indicating if a GitHub Draft Release should be created instead of publishing an actual GitHub Release. | `false` | | ||
| `releaseNameTemplate` | A [Lodash template](https://lodash.com/docs#template) to customize the github release's name | `<%= nextverison.name %>` | | ||
| `releaseBodyTemplate` | A [Lodash template](https://lodash.com/docs#template) to customize the github release's body | `<%= nextverison.notes %>` | | ||
| `discussionCategoryName` | The category name in which to create a linked discussion to the release. Set to `false` to disable creating discussion for a release. | `false` | | ||
@@ -100,0 +101,0 @@ #### proxy |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74181
1265
228
8
31