@semantic-release/github 8.0.9 → 9.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -27
- package/index.js +62 -28
- package/lib/add-channel.js +57 -28
- package/lib/definitions/constants.js +2 -4
- package/lib/definitions/errors.js +154 -72
- package/lib/definitions/retry.js +1 -3
- package/lib/definitions/throttle.js +1 -3
- package/lib/fail.js +49 -30
- package/lib/find-sr-issues.js +4 -4
- package/lib/get-error.js +6 -5
- package/lib/get-fail-comment.js +10 -8
- package/lib/get-release-links.js +10 -7
- package/lib/get-search-queries.js +6 -3
- package/lib/get-success-comment.js +15 -8
- package/lib/glob-assets.js +63 -52
- package/lib/is-prerelease.js +3 -1
- package/lib/octokit.js +76 -0
- package/lib/parse-github-url.js +15 -7
- package/lib/publish.js +100 -51
- package/lib/resolve-config.js +34 -21
- package/lib/success.js +154 -89
- package/lib/verify.js +67 -33
- package/package.json +26 -46
- package/lib/get-client.js +0 -24
- package/lib/semantic-release-octokit.js +0 -35
package/lib/glob-assets.js
CHANGED
|
@@ -1,65 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
const {isPlainObject, castArray, uniqWith, uniq} = require('lodash');
|
|
3
|
-
const dirGlob = require('dir-glob');
|
|
4
|
-
const globby = require('globby');
|
|
5
|
-
const debug = require('debug')('semantic-release:github');
|
|
1
|
+
import { basename, resolve } from "node:path";
|
|
6
2
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
...(await Promise.all(
|
|
12
|
-
assets.map(async (asset) => {
|
|
13
|
-
// Wrap single glob definition in Array
|
|
14
|
-
let glob = castArray(isPlainObject(asset) ? asset.path : asset);
|
|
15
|
-
// TODO Temporary workaround for https://github.com/mrmlnc/fast-glob/issues/47
|
|
16
|
-
glob = uniq([...(await dirGlob(glob, {cwd})), ...glob]);
|
|
3
|
+
import { isPlainObject, castArray, uniqWith, uniq } from "lodash-es";
|
|
4
|
+
import dirGlob from "dir-glob";
|
|
5
|
+
import { globby } from "globby";
|
|
6
|
+
import debugFactory from "debug";
|
|
17
7
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
const debug = debugFactory("semantic-release:github");
|
|
9
|
+
|
|
10
|
+
export default async function globAssets({ cwd }, assets) {
|
|
11
|
+
return uniqWith(
|
|
12
|
+
(
|
|
13
|
+
await Promise.all(
|
|
14
|
+
assets.map(async (asset) => {
|
|
15
|
+
// Wrap single glob definition in Array
|
|
16
|
+
let glob = castArray(isPlainObject(asset) ? asset.path : asset);
|
|
17
|
+
|
|
18
|
+
// TODO Temporary workaround for https://github.com/mrmlnc/fast-glob/issues/47
|
|
19
|
+
glob = uniq([...(await dirGlob(glob, { cwd })), ...glob]);
|
|
26
20
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
21
|
+
// Skip solo negated pattern (avoid to include every non js file with `!**/*.js`)
|
|
22
|
+
if (glob.length <= 1 && glob[0].startsWith("!")) {
|
|
23
|
+
debug(
|
|
24
|
+
"skipping the negated glob %o as its alone in its group and would retrieve a large amount of files",
|
|
25
|
+
glob[0]
|
|
26
|
+
);
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
34
29
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return globbed.map((file) => ({...asset, path: file, name: path.basename(file)}));
|
|
43
|
-
}
|
|
30
|
+
const globbed = await globby(glob, {
|
|
31
|
+
cwd,
|
|
32
|
+
expandDirectories: false, // TODO Temporary workaround for https://github.com/mrmlnc/fast-glob/issues/47
|
|
33
|
+
gitignore: false,
|
|
34
|
+
dot: true,
|
|
35
|
+
onlyFiles: false,
|
|
36
|
+
});
|
|
44
37
|
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
if (isPlainObject(asset)) {
|
|
39
|
+
if (globbed.length > 1) {
|
|
40
|
+
// If asset is an Object with a glob the `path` property that resolve to multiple files,
|
|
41
|
+
// Output an Object definition for each file matched and set each one with:
|
|
42
|
+
// - `path` of the matched file
|
|
43
|
+
// - `name` based on the actual file name (to avoid assets with duplicate `name`)
|
|
47
44
|
// - other properties of the original asset definition
|
|
48
|
-
return
|
|
45
|
+
return globbed.map((file) => ({
|
|
46
|
+
...asset,
|
|
47
|
+
path: file,
|
|
48
|
+
name: basename(file),
|
|
49
|
+
}));
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
52
|
+
// If asset is an Object, output an Object definition with:
|
|
53
|
+
// - `path` of the matched file if there is one, or the original `path` definition (will be considered as a missing file)
|
|
54
|
+
// - other properties of the original asset definition
|
|
55
|
+
return { ...asset, path: globbed[0] || asset.path };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (globbed.length > 0) {
|
|
59
|
+
// If asset is a String definition, output each files matched
|
|
60
|
+
return globbed;
|
|
61
|
+
}
|
|
55
62
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
))
|
|
63
|
+
// If asset is a String definition but no match is found, output the elements of the original glob (each one will be considered as a missing file)
|
|
64
|
+
return glob;
|
|
65
|
+
})
|
|
66
|
+
// Sort with Object first, to prioritize Object definition over Strings in dedup
|
|
61
67
|
)
|
|
68
|
+
)
|
|
69
|
+
.flat()
|
|
62
70
|
.sort((asset) => (isPlainObject(asset) ? -1 : 1)),
|
|
63
71
|
// Compare `path` property if Object definition, value itself if String
|
|
64
|
-
(a, b) =>
|
|
72
|
+
(a, b) =>
|
|
73
|
+
resolve(cwd, isPlainObject(a) ? a.path : a) ===
|
|
74
|
+
resolve(cwd, isPlainObject(b) ? b.path : b)
|
|
65
75
|
);
|
|
76
|
+
}
|
package/lib/is-prerelease.js
CHANGED
package/lib/octokit.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/* c8 ignore start */
|
|
2
|
+
// @ts-check
|
|
3
|
+
|
|
4
|
+
import { createRequire } from "node:module";
|
|
5
|
+
|
|
6
|
+
// If maintaining @octokit/core and the separate plugins gets to cumbersome
|
|
7
|
+
// then the `octokit` package can be used which has all these plugins included.
|
|
8
|
+
// However the `octokit` package has a lot of other things we don't care about.
|
|
9
|
+
// We use only the bits we need to minimize the size of the package.
|
|
10
|
+
import { Octokit } from "@octokit/core";
|
|
11
|
+
import { paginateRest } from "@octokit/plugin-paginate-rest";
|
|
12
|
+
import { retry } from "@octokit/plugin-retry";
|
|
13
|
+
import { throttling } from "@octokit/plugin-throttling";
|
|
14
|
+
import urljoin from "url-join";
|
|
15
|
+
import { HttpProxyAgent } from "http-proxy-agent";
|
|
16
|
+
import { HttpsProxyAgent } from "https-proxy-agent";
|
|
17
|
+
|
|
18
|
+
import { RETRY_CONF } from "./definitions/retry.js";
|
|
19
|
+
import { THROTTLE_CONF } from "./definitions/throttle.js";
|
|
20
|
+
|
|
21
|
+
// NOTE: replace with import ... assert { type: 'json' } once supported
|
|
22
|
+
const require = createRequire(import.meta.url);
|
|
23
|
+
const pkg = require("../package.json");
|
|
24
|
+
|
|
25
|
+
const onRetry = (retryAfter, options, octokit, retryCount) => {
|
|
26
|
+
octokit.log.warn(
|
|
27
|
+
`Request quota exhausted for request ${options.method} ${options.url}`
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
if (retryCount <= RETRY_CONF.retries) {
|
|
31
|
+
octokit.log.debug(`Will retry after ${retryAfter}.`);
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const SemanticReleaseOctokit = Octokit.plugin(
|
|
37
|
+
paginateRest,
|
|
38
|
+
retry,
|
|
39
|
+
throttling
|
|
40
|
+
).defaults({
|
|
41
|
+
userAgent: `@semantic-release/github v${pkg.version}`,
|
|
42
|
+
retry: RETRY_CONF,
|
|
43
|
+
throttle: {
|
|
44
|
+
...THROTTLE_CONF,
|
|
45
|
+
onRateLimit: onRetry,
|
|
46
|
+
onSecondaryRateLimit: onRetry,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
/* c8 ignore stop */
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @param {{githubToken: string, proxy: any} | {githubUrl: string, githubApiPathPrefix: string, githubToken: string, proxy: any}} options
|
|
53
|
+
* @returns {{ auth: string, baseUrl?: string, request: { agent?: any } }}
|
|
54
|
+
*/
|
|
55
|
+
export function toOctokitOptions(options) {
|
|
56
|
+
const baseUrl =
|
|
57
|
+
"githubUrl" in options && options.githubUrl
|
|
58
|
+
? urljoin(options.githubUrl, options.githubApiPathPrefix)
|
|
59
|
+
: undefined;
|
|
60
|
+
|
|
61
|
+
const agent = options.proxy
|
|
62
|
+
? baseUrl && new URL(baseUrl).protocol.replace(":", "") === "http"
|
|
63
|
+
? // Some `proxy.headers` need to be passed as second arguments since version 6 or 7
|
|
64
|
+
// For simplicity, we just pass the same proxy object twice. It works 🤷🏻
|
|
65
|
+
new HttpProxyAgent(options.proxy, options.proxy)
|
|
66
|
+
: new HttpsProxyAgent(options.proxy, options.proxy)
|
|
67
|
+
: undefined;
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
...(baseUrl ? { baseUrl } : {}),
|
|
71
|
+
auth: options.githubToken,
|
|
72
|
+
request: {
|
|
73
|
+
agent,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
}
|
package/lib/parse-github-url.js
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
const [match, auth, host, path] =
|
|
1
|
+
export default function parseGitHubUrl(repositoryUrl) {
|
|
2
|
+
const [match, auth, host, path] =
|
|
3
|
+
/^(?!.+:\/\/)(?:(?<auth>.*)@)?(?<host>.*?):(?<path>.*)$/.exec(
|
|
4
|
+
repositoryUrl
|
|
5
|
+
) || [];
|
|
3
6
|
try {
|
|
4
|
-
const [, owner, repo] =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
const [, owner, repo] =
|
|
8
|
+
/^\/(?<owner>[^/]+)?\/?(?<repo>.+?)(?:\.git)?$/.exec(
|
|
9
|
+
new URL(
|
|
10
|
+
match
|
|
11
|
+
? `ssh://${auth ? `${auth}@` : ""}${host}/${path}`
|
|
12
|
+
: repositoryUrl
|
|
13
|
+
).pathname
|
|
14
|
+
);
|
|
15
|
+
return { owner, repo };
|
|
8
16
|
} catch {
|
|
9
17
|
return {};
|
|
10
18
|
}
|
|
11
|
-
}
|
|
19
|
+
}
|
package/lib/publish.js
CHANGED
|
@@ -1,26 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { resolve, basename, extname } from "node:path";
|
|
2
|
+
import { stat, readFile } from "node:fs/promises";
|
|
3
|
+
|
|
4
|
+
import { isPlainObject, template } from "lodash-es";
|
|
5
|
+
import mime from "mime";
|
|
6
|
+
import debugFactory from "debug";
|
|
7
|
+
|
|
8
|
+
import { RELEASE_NAME } from "./definitions/constants.js";
|
|
9
|
+
import parseGithubUrl from "./parse-github-url.js";
|
|
10
|
+
import globAssets from "./glob-assets.js";
|
|
11
|
+
import resolveConfig from "./resolve-config.js";
|
|
12
|
+
import { toOctokitOptions, SemanticReleaseOctokit } from "./octokit.js";
|
|
13
|
+
import isPrerelease from "./is-prerelease.js";
|
|
14
|
+
|
|
15
|
+
const debug = debugFactory("semantic-release:github");
|
|
16
|
+
|
|
17
|
+
export default async function publish(pluginConfig, context, { Octokit }) {
|
|
14
18
|
const {
|
|
15
19
|
cwd,
|
|
16
|
-
options: {repositoryUrl},
|
|
20
|
+
options: { repositoryUrl },
|
|
17
21
|
branch,
|
|
18
|
-
nextRelease: {name, gitTag, notes},
|
|
22
|
+
nextRelease: { name, gitTag, notes },
|
|
19
23
|
logger,
|
|
20
24
|
} = context;
|
|
21
|
-
const {
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
const {
|
|
26
|
+
githubToken,
|
|
27
|
+
githubUrl,
|
|
28
|
+
githubApiPathPrefix,
|
|
29
|
+
proxy,
|
|
30
|
+
assets,
|
|
31
|
+
draftRelease,
|
|
32
|
+
} = resolveConfig(pluginConfig, context);
|
|
33
|
+
const { owner, repo } = parseGithubUrl(repositoryUrl);
|
|
34
|
+
const octokit = new Octokit(
|
|
35
|
+
toOctokitOptions({
|
|
36
|
+
githubToken,
|
|
37
|
+
githubUrl,
|
|
38
|
+
githubApiPathPrefix,
|
|
39
|
+
proxy,
|
|
40
|
+
})
|
|
41
|
+
);
|
|
24
42
|
const release = {
|
|
25
43
|
owner,
|
|
26
44
|
repo,
|
|
@@ -31,29 +49,45 @@ module.exports = async (pluginConfig, context) => {
|
|
|
31
49
|
prerelease: isPrerelease(branch),
|
|
32
50
|
};
|
|
33
51
|
|
|
34
|
-
debug(
|
|
52
|
+
debug("release object: %O", release);
|
|
35
53
|
|
|
36
|
-
|
|
54
|
+
const draftReleaseOptions = { ...release, draft: true };
|
|
55
|
+
|
|
56
|
+
// When there are no assets, we publish a release directly.
|
|
37
57
|
if (!assets || assets.length === 0) {
|
|
58
|
+
// If draftRelease is true we create a draft release instead.
|
|
59
|
+
if (draftRelease) {
|
|
60
|
+
const {
|
|
61
|
+
data: { html_url: url, id: releaseId },
|
|
62
|
+
} = await octokit.request(
|
|
63
|
+
"POST /repos/{owner}/{repo}/releases",
|
|
64
|
+
draftReleaseOptions
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
logger.log("Created GitHub draft release: %s", url);
|
|
68
|
+
return { url, name: RELEASE_NAME, id: releaseId };
|
|
69
|
+
}
|
|
70
|
+
|
|
38
71
|
const {
|
|
39
|
-
data: {html_url: url, id: releaseId},
|
|
40
|
-
} = await octokit.request(
|
|
72
|
+
data: { html_url: url, id: releaseId },
|
|
73
|
+
} = await octokit.request("POST /repos/{owner}/{repo}/releases", release);
|
|
41
74
|
|
|
42
|
-
logger.log(
|
|
43
|
-
return {url, name: RELEASE_NAME, id: releaseId};
|
|
75
|
+
logger.log("Published GitHub release: %s", url);
|
|
76
|
+
return { url, name: RELEASE_NAME, id: releaseId };
|
|
44
77
|
}
|
|
45
78
|
|
|
46
79
|
// We'll create a draft release, append the assets to it, and then publish it.
|
|
47
80
|
// This is so that the assets are available when we get a Github release event.
|
|
48
|
-
const draftRelease = {...release, draft: true};
|
|
49
|
-
|
|
50
81
|
const {
|
|
51
|
-
data: {upload_url: uploadUrl, id: releaseId},
|
|
52
|
-
} = await octokit.request(
|
|
82
|
+
data: { upload_url: uploadUrl, html_url: draftUrl, id: releaseId },
|
|
83
|
+
} = await octokit.request(
|
|
84
|
+
"POST /repos/{owner}/{repo}/releases",
|
|
85
|
+
draftReleaseOptions
|
|
86
|
+
);
|
|
53
87
|
|
|
54
88
|
// Append assets to the release
|
|
55
89
|
const globbedAssets = await globAssets(context, assets);
|
|
56
|
-
debug(
|
|
90
|
+
debug("globed assets: %o", globbedAssets);
|
|
57
91
|
|
|
58
92
|
await Promise.all(
|
|
59
93
|
globbedAssets.map(async (asset) => {
|
|
@@ -61,52 +95,67 @@ module.exports = async (pluginConfig, context) => {
|
|
|
61
95
|
let file;
|
|
62
96
|
|
|
63
97
|
try {
|
|
64
|
-
file = await stat(
|
|
98
|
+
file = await stat(resolve(cwd, filePath));
|
|
65
99
|
} catch {
|
|
66
|
-
logger.error(
|
|
100
|
+
logger.error(
|
|
101
|
+
"The asset %s cannot be read, and will be ignored.",
|
|
102
|
+
filePath
|
|
103
|
+
);
|
|
67
104
|
return;
|
|
68
105
|
}
|
|
69
106
|
|
|
70
107
|
if (!file || !file.isFile()) {
|
|
71
|
-
logger.error(
|
|
108
|
+
logger.error(
|
|
109
|
+
"The asset %s is not a file, and will be ignored.",
|
|
110
|
+
filePath
|
|
111
|
+
);
|
|
72
112
|
return;
|
|
73
113
|
}
|
|
74
114
|
|
|
75
|
-
const fileName = template(asset.name ||
|
|
115
|
+
const fileName = template(asset.name || basename(filePath))(context);
|
|
76
116
|
const upload = {
|
|
77
|
-
method:
|
|
117
|
+
method: "POST",
|
|
78
118
|
url: uploadUrl,
|
|
79
|
-
data: await readFile(
|
|
119
|
+
data: await readFile(resolve(cwd, filePath)),
|
|
80
120
|
name: fileName,
|
|
81
121
|
headers: {
|
|
82
|
-
|
|
83
|
-
|
|
122
|
+
"content-type": mime.getType(extname(fileName)) || "text/plain",
|
|
123
|
+
"content-length": file.size,
|
|
84
124
|
},
|
|
85
125
|
};
|
|
86
126
|
|
|
87
|
-
debug(
|
|
88
|
-
debug(
|
|
127
|
+
debug("file path: %o", filePath);
|
|
128
|
+
debug("file name: %o", fileName);
|
|
89
129
|
|
|
90
130
|
if (isPlainObject(asset) && asset.label) {
|
|
91
131
|
upload.label = template(asset.label)(context);
|
|
92
132
|
}
|
|
93
133
|
|
|
94
134
|
const {
|
|
95
|
-
data: {browser_download_url: downloadUrl},
|
|
135
|
+
data: { browser_download_url: downloadUrl },
|
|
96
136
|
} = await octokit.request(upload);
|
|
97
|
-
logger.log(
|
|
137
|
+
logger.log("Published file %s", downloadUrl);
|
|
98
138
|
})
|
|
99
139
|
);
|
|
100
140
|
|
|
141
|
+
// If we want to create a draft we don't need to update the release again
|
|
142
|
+
if (draftRelease) {
|
|
143
|
+
logger.log("Created GitHub draft release: %s", draftUrl);
|
|
144
|
+
return { url: draftUrl, name: RELEASE_NAME, id: releaseId };
|
|
145
|
+
}
|
|
146
|
+
|
|
101
147
|
const {
|
|
102
|
-
data: {html_url: url},
|
|
103
|
-
} = await octokit.request(
|
|
104
|
-
owner,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
148
|
+
data: { html_url: url },
|
|
149
|
+
} = await octokit.request(
|
|
150
|
+
"PATCH /repos/{owner}/{repo}/releases/{release_id}",
|
|
151
|
+
{
|
|
152
|
+
owner,
|
|
153
|
+
repo,
|
|
154
|
+
release_id: releaseId,
|
|
155
|
+
draft: false,
|
|
156
|
+
}
|
|
157
|
+
);
|
|
109
158
|
|
|
110
|
-
logger.log(
|
|
111
|
-
return {url, name: RELEASE_NAME, id: releaseId};
|
|
112
|
-
}
|
|
159
|
+
logger.log("Published GitHub release: %s", url);
|
|
160
|
+
return { url, name: RELEASE_NAME, id: releaseId };
|
|
161
|
+
}
|
package/lib/resolve-config.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { isNil, castArray } from "lodash-es";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default function resolveConfig(
|
|
4
4
|
{
|
|
5
5
|
githubUrl,
|
|
6
6
|
githubApiPathPrefix,
|
|
@@ -13,23 +13,36 @@ module.exports = (
|
|
|
13
13
|
assignees,
|
|
14
14
|
releasedLabels,
|
|
15
15
|
addReleases,
|
|
16
|
+
draftRelease,
|
|
16
17
|
},
|
|
17
|
-
{env}
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
18
|
+
{ env }
|
|
19
|
+
) {
|
|
20
|
+
return {
|
|
21
|
+
githubToken: env.GH_TOKEN || env.GITHUB_TOKEN,
|
|
22
|
+
githubUrl: githubUrl || env.GITHUB_API_URL || env.GH_URL || env.GITHUB_URL,
|
|
23
|
+
githubApiPathPrefix:
|
|
24
|
+
githubApiPathPrefix || env.GH_PREFIX || env.GITHUB_PREFIX || "",
|
|
25
|
+
proxy: isNil(proxy) ? env.http_proxy || env.HTTP_PROXY || false : proxy,
|
|
26
|
+
assets: assets ? castArray(assets) : assets,
|
|
27
|
+
successComment,
|
|
28
|
+
failTitle: isNil(failTitle)
|
|
29
|
+
? "The automated release is failing 🚨"
|
|
30
|
+
: failTitle,
|
|
31
|
+
failComment,
|
|
32
|
+
labels: isNil(labels)
|
|
33
|
+
? ["semantic-release"]
|
|
34
|
+
: labels === false
|
|
35
|
+
? false
|
|
36
|
+
: castArray(labels),
|
|
37
|
+
assignees: assignees ? castArray(assignees) : assignees,
|
|
38
|
+
releasedLabels: isNil(releasedLabels)
|
|
39
|
+
? [
|
|
40
|
+
`released<%= nextRelease.channel ? \` on @\${nextRelease.channel}\` : "" %>`,
|
|
41
|
+
]
|
|
42
|
+
: releasedLabels === false
|
|
43
|
+
? false
|
|
44
|
+
: castArray(releasedLabels),
|
|
45
|
+
addReleases: isNil(addReleases) ? false : addReleases,
|
|
46
|
+
draftRelease: isNil(draftRelease) ? false : draftRelease,
|
|
47
|
+
};
|
|
48
|
+
}
|