Socket
Socket
Sign inDemoInstall

@semantic-release/github

Package Overview
Dependencies
Maintainers
4
Versions
168
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@semantic-release/github - npm Package Compare versions

Comparing version 9.0.3 to 9.0.4

20

index.js

@@ -17,3 +17,3 @@ /* eslint require-atomic-updates: off */

context,
{ Octokit = SemanticReleaseOctokit } = {}
{ Octokit = SemanticReleaseOctokit } = {},
) {

@@ -25,3 +25,3 @@ const { options } = context;

castArray(options.publish).find(
(config) => config.path && config.path === "@semantic-release/github"
(config) => config.path && config.path === "@semantic-release/github",
) || {};

@@ -32,11 +32,11 @@

pluginConfig.successComment,
publishPlugin.successComment
publishPlugin.successComment,
);
pluginConfig.failComment = defaultTo(
pluginConfig.failComment,
publishPlugin.failComment
publishPlugin.failComment,
);
pluginConfig.failTitle = defaultTo(
pluginConfig.failTitle,
publishPlugin.failTitle
publishPlugin.failTitle,
);

@@ -46,3 +46,3 @@ pluginConfig.labels = defaultTo(pluginConfig.labels, publishPlugin.labels);

pluginConfig.assignees,
publishPlugin.assignees
publishPlugin.assignees,
);

@@ -58,3 +58,3 @@ }

context,
{ Octokit = SemanticReleaseOctokit } = {}
{ Octokit = SemanticReleaseOctokit } = {},
) {

@@ -72,3 +72,3 @@ if (!verified) {

context,
{ Octokit = SemanticReleaseOctokit } = {}
{ Octokit = SemanticReleaseOctokit } = {},
) {

@@ -86,3 +86,3 @@ if (!verified) {

context,
{ Octokit = SemanticReleaseOctokit } = {}
{ Octokit = SemanticReleaseOctokit } = {},
) {

@@ -100,3 +100,3 @@ if (!verified) {

context,
{ Octokit = SemanticReleaseOctokit } = {}
{ Octokit = SemanticReleaseOctokit } = {},
) {

@@ -103,0 +103,0 @@ if (!verified) {

@@ -20,3 +20,3 @@ import debugFactory from "debug";

pluginConfig,
context
context,
);

@@ -30,3 +30,3 @@ const { owner, repo } = parseGithubUrl(repositoryUrl);

proxy,
})
}),
);

@@ -77,3 +77,3 @@ let releaseId;

"PATCH /repos/{owner}/{repo}/releases/{release_id}",
{ ...release, release_id: releaseId }
{ ...release, release_id: releaseId },
);

@@ -80,0 +80,0 @@

@@ -24,3 +24,3 @@ import { inspect } from "node:util";

details: `The [assets option](${linkify(
"README.md#assets"
"README.md#assets",
)}) must be an \`Array\` of \`Strings\` or \`Objects\` with a \`path\` property.

@@ -36,7 +36,7 @@

details: `The [successComment option](${linkify(
"README.md#successcomment"
"README.md#successcomment",
)}) if defined, must be a non empty \`String\`.
Your configuration for the \`successComment\` option is \`${stringify(
successComment
successComment,
)}\`.`,

@@ -50,7 +50,7 @@ };

details: `The [failTitle option](${linkify(
"README.md#failtitle"
"README.md#failtitle",
)}) if defined, must be a non empty \`String\`.
Your configuration for the \`failTitle\` option is \`${stringify(
failTitle
failTitle,
)}\`.`,

@@ -64,7 +64,7 @@ };

details: `The [failComment option](${linkify(
"README.md#failcomment"
"README.md#failcomment",
)}) if defined, must be a non empty \`String\`.
Your configuration for the \`failComment\` option is \`${stringify(
failComment
failComment,
)}\`.`,

@@ -78,3 +78,3 @@ };

details: `The [labels option](${linkify(
"README.md#options"
"README.md#options",
)}) if defined, must be an \`Array\` of non empty \`String\`.

@@ -90,7 +90,7 @@

details: `The [assignees option](${linkify(
"README.md#options"
"README.md#options",
)}) must be an \`Array\` of non empty \`Strings\`.
Your configuration for the \`assignees\` option is \`${stringify(
assignees
assignees,
)}\`.`,

@@ -104,7 +104,7 @@ };

details: `The [releasedLabels option](${linkify(
"README.md#options"
"README.md#options",
)}) if defined, must be an \`Array\` of non empty \`String\`.
Your configuration for the \`releasedLabels\` option is \`${stringify(
releasedLabels
releasedLabels,
)}\`.`,

@@ -118,7 +118,7 @@ };

details: `The [addReleases option](${linkify(
"README.md#options"
"README.md#options",
)}) if defined, must be one of \`false|top|bottom\`.
Your configuration for the \`addReleases\` option is \`${stringify(
addReleases
addReleases,
)}\`.`,

@@ -132,7 +132,7 @@ };

details: `The [draftRelease option](${linkify(
"README.md#options"
"README.md#options",
)}) if defined, must be a \`Boolean\`.
Your configuration for the \`draftRelease\` option is \`${stringify(
draftRelease
draftRelease,
)}\`.`,

@@ -155,3 +155,3 @@ };

details: `The [proxy option](${linkify(
"README.md#proxy"
"README.md#proxy",
)}) must be a \`String\` or an \`Objects\` with a \`host\` and a \`port\` property.

@@ -171,3 +171,3 @@

If you are using [GitHub Enterprise](https://enterprise.github.com) please make sure to configure the \`githubUrl\` and \`githubApiPathPrefix\` [options](${linkify(
"README.md#options"
"README.md#options",
)}).`,

@@ -181,3 +181,3 @@ };

details: `The user associated with the [GitHub token](${linkify(
"README.md#github-authentication"
"README.md#github-authentication",
)}) configured in the \`GH_TOKEN\` or \`GITHUB_TOKEN\` environment variable must allows to push to the repository ${owner}/${repo}.

@@ -193,3 +193,3 @@

details: `The [GitHub token](${linkify(
"README.md#github-authentication"
"README.md#github-authentication",
)}) configured in the \`GH_TOKEN\` or \`GITHUB_TOKEN\` environment variable must be a valid [personal token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line) allowing to push to the repository ${owner}/${repo}.

@@ -205,3 +205,3 @@

details: `A [GitHub personal token](${linkify(
"README.md#github-authentication"
"README.md#github-authentication",
)}) must be created and set in the \`GH_TOKEN\` or \`GITHUB_TOKEN\` environment variable on your CI environment.

@@ -208,0 +208,0 @@

@@ -35,3 +35,3 @@ import { template } from "lodash-es";

const octokit = new Octokit(
toOctokitOptions({ githubToken, githubUrl, githubApiPathPrefix, proxy })
toOctokitOptions({ githubToken, githubUrl, githubApiPathPrefix, proxy }),
);

@@ -41,3 +41,3 @@ // In case the repo changed name, get the new `repo`/`owner` as the search API will not follow redirects

"GET /repos/{owner}/{repo}",
parseGithubUrl(repositoryUrl)
parseGithubUrl(repositoryUrl),
);

@@ -58,3 +58,3 @@ const [owner, repo] = repoData.full_name.split("/");

"POST /repos/{owner}/{repo}/issues/{issue_number}/comments",
comment
comment,
);

@@ -61,0 +61,0 @@ logger.log("Added comment to issue #%d: %s.", srIssue.number, url);

@@ -14,3 +14,3 @@ import { RELEASE_NAME } from "./definitions/constants.js";

releaseInfos.filter(
(releaseInfo) => releaseInfo.name && releaseInfo.name !== RELEASE_NAME
(releaseInfo) => releaseInfo.name && releaseInfo.name !== RELEASE_NAME,
);

@@ -17,0 +17,0 @@

@@ -25,3 +25,3 @@ import { basename, resolve } from "node:path";

"skipping the negated glob %o as its alone in its group and would retrieve a large amount of files",
glob[0]
glob[0],
);

@@ -66,3 +66,3 @@ return [];

return glob;
})
}),
// Sort with Object first, to prioritize Object definition over Strings in dedup

@@ -76,4 +76,4 @@ )

resolve(cwd, isPlainObject(a) ? a.path : a) ===
resolve(cwd, isPlainObject(b) ? b.path : b)
resolve(cwd, isPlainObject(b) ? b.path : b),
);
}

@@ -27,3 +27,3 @@ /* c8 ignore start */

octokit.log.warn(
`Request quota exhausted for request ${options.method} ${options.url}`
`Request quota exhausted for request ${options.method} ${options.url}`,
);

@@ -40,3 +40,3 @@

retry,
throttling
throttling,
).defaults({

@@ -43,0 +43,0 @@ userAgent: `@semantic-release/github v${pkg.version}`,

export default function parseGitHubUrl(repositoryUrl) {
const [match, auth, host, path] =
/^(?!.+:\/\/)(?:(?<auth>.*)@)?(?<host>.*?):(?<path>.*)$/.exec(
repositoryUrl
repositoryUrl,
) || [];

@@ -12,4 +12,4 @@ try {

? `ssh://${auth ? `${auth}@` : ""}${host}/${path}`
: repositoryUrl
).pathname
: repositoryUrl,
).pathname,
);

@@ -16,0 +16,0 @@ return { owner, repo };

@@ -40,3 +40,3 @@ import { resolve, basename, extname } from "node:path";

proxy,
})
}),
);

@@ -65,3 +65,3 @@ const release = {

"POST /repos/{owner}/{repo}/releases",
draftReleaseOptions
draftReleaseOptions,
);

@@ -87,3 +87,3 @@

"POST /repos/{owner}/{repo}/releases",
draftReleaseOptions
draftReleaseOptions,
);

@@ -105,3 +105,3 @@

"The asset %s cannot be read, and will be ignored.",
filePath
filePath,
);

@@ -114,3 +114,3 @@ return;

"The asset %s is not a file, and will be ignored.",
filePath
filePath,
);

@@ -143,3 +143,3 @@ return;

logger.log("Published file %s", downloadUrl);
})
}),
);

@@ -162,3 +162,3 @@

draft: false,
}
},
);

@@ -165,0 +165,0 @@

@@ -18,3 +18,3 @@ import { isNil, castArray } from "lodash-es";

},
{ env }
{ env },
) {

@@ -21,0 +21,0 @@ return {

@@ -39,3 +39,3 @@ import { isNil, uniqBy, template, flatten, isEmpty } from "lodash-es";

const octokit = new Octokit(
toOctokitOptions({ githubToken, githubUrl, githubApiPathPrefix, proxy })
toOctokitOptions({ githubToken, githubUrl, githubApiPathPrefix, proxy }),
);

@@ -46,3 +46,3 @@

"GET /repos/{owner}/{repo}",
parseGithubUrl(repositoryUrl)
parseGithubUrl(repositoryUrl),
);

@@ -58,3 +58,3 @@ const [owner, repo] = repoData.full_name.split("/");

"github",
githubUrl ? { hosts: [githubUrl] } : {}
githubUrl ? { hosts: [githubUrl] } : {},
);

@@ -66,6 +66,6 @@ const releaseInfos = releases.filter((release) => Boolean(release.name));

`repo:${owner}/${repo}+type:pr+is:merged`,
shas
shas,
).map(
async (q) =>
(await octokit.request("GET /search/issues", { q })).data.items
(await octokit.request("GET /search/issues", { q })).data.items,
);

@@ -76,3 +76,3 @@

flatten(searchQueriesResults),
"number"
"number",
);

@@ -88,3 +88,3 @@ const prs = await pFilter(

pull_number: number,
}
},
);

@@ -100,6 +100,6 @@ const matchingCommit = commits.find(({ sha }) => shas.includes(sha));

pull_number: number,
}
},
);
return shas.includes(pullRequest.merge_commit_sha);
}
},
);

@@ -109,3 +109,3 @@

"found pull requests: %O",
prs.map((pr) => pr.number)
prs.map((pr) => pr.number),
);

@@ -124,10 +124,10 @@

(action) =>
isNil(action.slug) || action.slug === `${owner}/${repo}`
isNil(action.slug) || action.slug === `${owner}/${repo}`,
)
.map((action) => ({
number: Number.parseInt(action.issue, 10),
}))
})),
)
: issues,
[]
[],
);

@@ -149,3 +149,3 @@

"POST /repos/{owner}/{repo}/issues/{issue_number}/comments",
comment
comment,
);

@@ -156,3 +156,3 @@ logger.log("Added comment to issue #%d: %s", issue.number, url);

const labels = releasedLabels.map((label) =>
template(label)(context)
template(label)(context),
);

@@ -166,3 +166,3 @@ await octokit.request(

data: labels,
}
},
);

@@ -175,3 +175,3 @@ logger.log("Added labels %O to issue #%d", labels, issue.number);

"Not allowed to add a comment to the issue #%d.",
issue.number
issue.number,
);

@@ -181,3 +181,3 @@ } else if (error.status === 404) {

"Failed to add a comment to the issue #%d as it doesn't exist.",
issue.number
issue.number,
);

@@ -188,3 +188,3 @@ } else {

"Failed to add a comment to the issue #%d.",
issue.number
issue.number,
);

@@ -194,3 +194,3 @@ // Don't throw right away and continue to update other issues

}
})
}),
);

@@ -221,3 +221,3 @@ }

"PATCH /repos/{owner}/{repo}/issues/{issue_number}",
updateIssue
updateIssue,
);

@@ -230,3 +230,3 @@ logger.log("Closed issue #%d: %s.", issue.number, url);

}
})
}),
);

@@ -237,3 +237,3 @@ }

const ghRelease = releases.find(
(release) => release.name && release.name === RELEASE_NAME
(release) => release.name && release.name === RELEASE_NAME,
);

@@ -255,3 +255,3 @@ if (!isNil(ghRelease)) {

body: newBody,
}
},
);

@@ -258,0 +258,0 @@ }

@@ -33,3 +33,3 @@ import {

isNonEmptyString(proxy.host) &&
isNumber(proxy.port))
isNumber(proxy.port)),
),

@@ -39,3 +39,3 @@ assets: isArrayOf(

isStringOrStringArray(asset) ||
(isPlainObject(asset) && isStringOrStringArray(asset.path))
(isPlainObject(asset) && isStringOrStringArray(asset.path)),
),

@@ -69,3 +69,3 @@ successComment: canBeDisabled(isNonEmptyString),

: errors,
[]
[],
);

@@ -76,3 +76,3 @@

"Verify GitHub authentication (%s)",
urlJoin(githubUrl, githubApiPathPrefix)
urlJoin(githubUrl, githubApiPathPrefix),
);

@@ -91,3 +91,3 @@ } else {

const octokit = new Octokit(
toOctokitOptions({ githubToken, githubUrl, githubApiPathPrefix, proxy })
toOctokitOptions({ githubToken, githubUrl, githubApiPathPrefix, proxy }),
);

@@ -94,0 +94,0 @@

{
"name": "@semantic-release/github",
"description": "semantic-release plugin to publish a GitHub release and comment on released Pull Requests/Issues",
"version": "9.0.3",
"version": "9.0.4",
"type": "module",

@@ -23,6 +23,6 @@ "author": "Pierre Vanduynslager (https://twitter.com/@pvdlg_)",

"dependencies": {
"@octokit/core": "^4.2.1",
"@octokit/plugin-paginate-rest": "^7.0.0",
"@octokit/plugin-retry": "^5.0.0",
"@octokit/plugin-throttling": "^6.0.0",
"@octokit/core": "^5.0.0",
"@octokit/plugin-paginate-rest": "^8.0.0",
"@octokit/plugin-retry": "^6.0.0",
"@octokit/plugin-throttling": "^7.0.0",
"@semantic-release/error": "^4.0.0",

@@ -42,10 +42,10 @@ "aggregate-error": "^4.0.1",

"devDependencies": {
"ava": "5.3.0",
"c8": "7.14.0",
"ava": "5.3.1",
"c8": "8.0.0",
"cpy": "10.1.0",
"fetch-mock": "npm:@gr2m/fetch-mock@9.11.0-pull-request-644.1",
"prettier": "2.8.8",
"semantic-release": "21.0.3",
"sinon": "15.1.0",
"tempy": "3.0.0"
"prettier": "3.0.0",
"semantic-release": "21.0.7",
"sinon": "15.2.0",
"tempy": "3.1.0"
},

@@ -52,0 +52,0 @@ "engines": {

@@ -212,3 +212,3 @@ # @semantic-release/github

The `releasedLabels` `` ['released<%= nextRelease.channel ? ` on @\${nextRelease.channel}` : "" %> from <%= branch.name %>'] `` will generate the label:
The `releasedLabels` ``['released<%= nextRelease.channel ? ` on @\${nextRelease.channel}` : "" %> from <%= branch.name %>']`` will generate the label:

@@ -215,0 +215,0 @@ > released on @next from branch next

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc