@semantic-release/github
Advanced tools
Comparing version 9.2.0 to 9.2.1
@@ -57,7 +57,2 @@ import { resolve, basename, extname } from "node:path"; | ||
// If discussionCategoryName is not undefined or false | ||
if (discussionCategoryName) { | ||
release.discussion_category_name = discussionCategoryName; | ||
} | ||
const draftReleaseOptions = { ...release, draft: true }; | ||
@@ -80,8 +75,18 @@ | ||
// add discussion_category_name if discussionCategoryName is not undefined or false | ||
if (discussionCategoryName) { | ||
release.discussion_category_name = discussionCategoryName; | ||
} | ||
const { | ||
data: { html_url: url, id: releaseId }, | ||
data: { html_url: url, id: releaseId, discussion_url }, | ||
} = await octokit.request("POST /repos/{owner}/{repo}/releases", release); | ||
logger.log("Published GitHub release: %s", url); | ||
return { url, name: RELEASE_NAME, id: releaseId }; | ||
if (discussionCategoryName) { | ||
logger.log("Created GitHub release discussion: %s", discussion_url); | ||
} | ||
return { url, name: RELEASE_NAME, id: releaseId, discussion_url }; | ||
} | ||
@@ -157,16 +162,28 @@ | ||
const patchRelease = { | ||
owner, | ||
repo, | ||
release_id: releaseId, | ||
draft: false, | ||
}; | ||
// add discussion_category_name if discussionCategoryName is not undefined or false | ||
if (discussionCategoryName) { | ||
patchRelease.discussion_category_name = discussionCategoryName; | ||
} | ||
const { | ||
data: { html_url: url }, | ||
data: { html_url: url, discussion_url }, | ||
} = await octokit.request( | ||
"PATCH /repos/{owner}/{repo}/releases/{release_id}", | ||
{ | ||
owner, | ||
repo, | ||
release_id: releaseId, | ||
draft: false, | ||
}, | ||
patchRelease, | ||
); | ||
logger.log("Published GitHub release: %s", url); | ||
return { url, name: RELEASE_NAME, id: releaseId }; | ||
if (discussionCategoryName) { | ||
logger.log("Created GitHub release discussion: %s", discussion_url); | ||
} | ||
return { url, name: RELEASE_NAME, id: releaseId, discussion_url }; | ||
} |
{ | ||
"name": "@semantic-release/github", | ||
"description": "semantic-release plugin to publish a GitHub release and comment on released Pull Requests/Issues", | ||
"version": "9.2.0", | ||
"version": "9.2.1", | ||
"type": "module", | ||
@@ -6,0 +6,0 @@ "author": "Pierre Vanduynslager (https://twitter.com/@pvdlg_)", |
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
74729
1276