@semantic-release/github 8.1.0 → 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 +29 -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 -78
- 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 +88 -58
- package/lib/resolve-config.js +33 -22
- package/lib/success.js +154 -89
- package/lib/verify.js +66 -33
- package/package.json +26 -46
- package/lib/get-client.js +0 -24
- package/lib/semantic-release-octokit.js +0 -35
|
@@ -1,121 +1,197 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
1
|
+
import { inspect } from "node:util";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
const require = createRequire(import.meta.url);
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
5
|
+
import { isString } from "lodash-es";
|
|
6
|
+
|
|
7
|
+
const pkg = require("../../package.json");
|
|
8
|
+
const HOMEPAGE = pkg.homepage;
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
const stringify = (object) =>
|
|
11
|
+
isString(object)
|
|
12
|
+
? object
|
|
13
|
+
: inspect(object, {
|
|
14
|
+
breakLength: Number.POSITIVE_INFINITY,
|
|
15
|
+
depth: 2,
|
|
16
|
+
maxArrayLength: 5,
|
|
17
|
+
});
|
|
18
|
+
const linkify = (file) => `${HOMEPAGE}/blob/master/${file}`;
|
|
19
|
+
|
|
20
|
+
export function EINVALIDASSETS({ assets }) {
|
|
21
|
+
return {
|
|
22
|
+
message: "Invalid `assets` option.",
|
|
13
23
|
details: `The [assets option](${linkify(
|
|
14
|
-
|
|
24
|
+
"README.md#assets"
|
|
15
25
|
)}) must be an \`Array\` of \`Strings\` or \`Objects\` with a \`path\` property.
|
|
16
26
|
|
|
17
27
|
Your configuration for the \`assets\` option is \`${stringify(assets)}\`.`,
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function EINVALIDSUCCESSCOMMENT({ successComment }) {
|
|
32
|
+
return {
|
|
33
|
+
message: "Invalid `successComment` option.",
|
|
21
34
|
details: `The [successComment option](${linkify(
|
|
22
|
-
|
|
35
|
+
"README.md#successcomment"
|
|
36
|
+
)}) if defined, must be a non empty \`String\`.
|
|
37
|
+
|
|
38
|
+
Your configuration for the \`successComment\` option is \`${stringify(
|
|
39
|
+
successComment
|
|
40
|
+
)}\`.`,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function EINVALIDFAILTITLE({ failTitle }) {
|
|
45
|
+
return {
|
|
46
|
+
message: "Invalid `failTitle` option.",
|
|
47
|
+
details: `The [failTitle option](${linkify(
|
|
48
|
+
"README.md#failtitle"
|
|
49
|
+
)}) if defined, must be a non empty \`String\`.
|
|
50
|
+
|
|
51
|
+
Your configuration for the \`failTitle\` option is \`${stringify(
|
|
52
|
+
failTitle
|
|
53
|
+
)}\`.`,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function EINVALIDFAILCOMMENT({ failComment }) {
|
|
58
|
+
return {
|
|
59
|
+
message: "Invalid `failComment` option.",
|
|
60
|
+
details: `The [failComment option](${linkify(
|
|
61
|
+
"README.md#failcomment"
|
|
23
62
|
)}) if defined, must be a non empty \`String\`.
|
|
24
63
|
|
|
25
|
-
Your configuration for the \`
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
message: 'Invalid `failComment` option.',
|
|
35
|
-
details: `The [failComment option](${linkify('README.md#failcomment')}) if defined, must be a non empty \`String\`.
|
|
36
|
-
|
|
37
|
-
Your configuration for the \`failComment\` option is \`${stringify(failComment)}\`.`,
|
|
38
|
-
}),
|
|
39
|
-
EINVALIDLABELS: ({labels}) => ({
|
|
40
|
-
message: 'Invalid `labels` option.',
|
|
64
|
+
Your configuration for the \`failComment\` option is \`${stringify(
|
|
65
|
+
failComment
|
|
66
|
+
)}\`.`,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function EINVALIDLABELS({ labels }) {
|
|
71
|
+
return {
|
|
72
|
+
message: "Invalid `labels` option.",
|
|
41
73
|
details: `The [labels option](${linkify(
|
|
42
|
-
|
|
74
|
+
"README.md#options"
|
|
43
75
|
)}) if defined, must be an \`Array\` of non empty \`String\`.
|
|
44
76
|
|
|
45
77
|
Your configuration for the \`labels\` option is \`${stringify(labels)}\`.`,
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function EINVALIDASSIGNEES({ assignees }) {
|
|
82
|
+
return {
|
|
83
|
+
message: "Invalid `assignees` option.",
|
|
84
|
+
details: `The [assignees option](${linkify(
|
|
85
|
+
"README.md#options"
|
|
86
|
+
)}) must be an \`Array\` of non empty \`Strings\`.
|
|
87
|
+
|
|
88
|
+
Your configuration for the \`assignees\` option is \`${stringify(
|
|
89
|
+
assignees
|
|
90
|
+
)}\`.`,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export function EINVALIDRELEASEDLABELS({ releasedLabels }) {
|
|
95
|
+
return {
|
|
96
|
+
message: "Invalid `releasedLabels` option.",
|
|
55
97
|
details: `The [releasedLabels option](${linkify(
|
|
56
|
-
|
|
98
|
+
"README.md#options"
|
|
57
99
|
)}) if defined, must be an \`Array\` of non empty \`String\`.
|
|
58
100
|
|
|
59
|
-
Your configuration for the \`releasedLabels\` option is \`${stringify(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
101
|
+
Your configuration for the \`releasedLabels\` option is \`${stringify(
|
|
102
|
+
releasedLabels
|
|
103
|
+
)}\`.`,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function EINVALIDADDRELEASES({ addReleases }) {
|
|
108
|
+
return {
|
|
109
|
+
message: "Invalid `addReleases` option.",
|
|
110
|
+
details: `The [addReleases option](${linkify(
|
|
111
|
+
"README.md#options"
|
|
112
|
+
)}) if defined, must be one of \`false|top|bottom\`.
|
|
113
|
+
|
|
114
|
+
Your configuration for the \`addReleases\` option is \`${stringify(
|
|
115
|
+
addReleases
|
|
116
|
+
)}\`.`,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function EINVALIDDRAFTRELEASE({ draftRelease }) {
|
|
121
|
+
return {
|
|
122
|
+
message: "Invalid `draftRelease` option.",
|
|
123
|
+
details: `The [draftRelease option](${linkify(
|
|
124
|
+
"README.md#options"
|
|
125
|
+
)}) if defined, must be a \`Boolean\`.
|
|
126
|
+
|
|
127
|
+
Your configuration for the \`draftRelease\` option is \`${stringify(
|
|
128
|
+
draftRelease
|
|
129
|
+
)}\`.`,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export function EINVALIDGITHUBURL() {
|
|
134
|
+
return {
|
|
135
|
+
message: "The git repository URL is not a valid GitHub URL.",
|
|
75
136
|
details: `The **semantic-release** \`repositoryUrl\` option must a valid GitHub URL with the format \`<GitHub_or_GHE_URL>/<owner>/<repo>.git\`.
|
|
76
137
|
|
|
77
138
|
By default the \`repositoryUrl\` option is retrieved from the \`repository\` property of your \`package.json\` or the [git origin url](https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes) of the repository cloned by your CI environment.`,
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export function EINVALIDPROXY({ proxy }) {
|
|
143
|
+
return {
|
|
144
|
+
message: "Invalid `proxy` option.",
|
|
81
145
|
details: `The [proxy option](${linkify(
|
|
82
|
-
|
|
146
|
+
"README.md#proxy"
|
|
83
147
|
)}) must be a \`String\` or an \`Objects\` with a \`host\` and a \`port\` property.
|
|
84
148
|
|
|
85
149
|
Your configuration for the \`proxy\` option is \`${stringify(proxy)}\`.`,
|
|
86
|
-
}
|
|
87
|
-
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export function EMISSINGREPO({ owner, repo }) {
|
|
154
|
+
return {
|
|
88
155
|
message: `The repository ${owner}/${repo} doesn't exist.`,
|
|
89
156
|
details: `The **semantic-release** \`repositoryUrl\` option must refer to your GitHub repository. The repository must be accessible with the [GitHub API](https://developer.github.com/v3).
|
|
90
157
|
|
|
91
158
|
By default the \`repositoryUrl\` option is retrieved from the \`repository\` property of your \`package.json\` or the [git origin url](https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes) of the repository cloned by your CI environment.
|
|
92
159
|
|
|
93
160
|
If you are using [GitHub Enterprise](https://enterprise.github.com) please make sure to configure the \`githubUrl\` and \`githubApiPathPrefix\` [options](${linkify(
|
|
94
|
-
|
|
161
|
+
"README.md#options"
|
|
95
162
|
)}).`,
|
|
96
|
-
}
|
|
97
|
-
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export function EGHNOPERMISSION({ owner, repo }) {
|
|
167
|
+
return {
|
|
98
168
|
message: `The GitHub token doesn't allow to push on the repository ${owner}/${repo}.`,
|
|
99
169
|
details: `The user associated with the [GitHub token](${linkify(
|
|
100
|
-
|
|
170
|
+
"README.md#github-authentication"
|
|
101
171
|
)}) configured in the \`GH_TOKEN\` or \`GITHUB_TOKEN\` environment variable must allows to push to the repository ${owner}/${repo}.
|
|
102
172
|
|
|
103
173
|
Please make sure the GitHub user associated with the token is an [owner](https://help.github.com/articles/permission-levels-for-a-user-account-repository/#owner-access-on-a-repository-owned-by-a-user-account) or a [collaborator](https://help.github.com/articles/permission-levels-for-a-user-account-repository/#collaborator-access-on-a-repository-owned-by-a-user-account) if the reposotory belong to a user account or has [write permissions](https://help.github.com/articles/managing-team-access-to-an-organization-repository) if the repository [belongs to an organization](https://help.github.com/articles/repository-permission-levels-for-an-organization).`,
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export function EINVALIDGHTOKEN({ owner, repo }) {
|
|
178
|
+
return {
|
|
179
|
+
message: "Invalid GitHub token.",
|
|
107
180
|
details: `The [GitHub token](${linkify(
|
|
108
|
-
|
|
181
|
+
"README.md#github-authentication"
|
|
109
182
|
)}) 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}.
|
|
110
183
|
|
|
111
184
|
Please make sure to set the \`GH_TOKEN\` or \`GITHUB_TOKEN\` environment variable in your CI with the exact value of the GitHub personal token.`,
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export function ENOGHTOKEN({ owner, repo }) {
|
|
189
|
+
return {
|
|
190
|
+
message: "No GitHub token specified.",
|
|
115
191
|
details: `A [GitHub personal token](${linkify(
|
|
116
|
-
|
|
192
|
+
"README.md#github-authentication"
|
|
117
193
|
)}) must be created and set in the \`GH_TOKEN\` or \`GITHUB_TOKEN\` environment variable on your CI environment.
|
|
118
194
|
|
|
119
195
|
Please make sure to create a [GitHub personal token](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line) and to set it in the \`GH_TOKEN\` or \`GITHUB_TOKEN\` environment variable on your CI environment. The token must allow to push to the repository ${owner}/${repo}.`,
|
|
120
|
-
}
|
|
121
|
-
}
|
|
196
|
+
};
|
|
197
|
+
}
|
package/lib/definitions/retry.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Default exponential backoff configuration for retries.
|
|
3
3
|
*/
|
|
4
|
-
const RETRY_CONF = {
|
|
4
|
+
export const RETRY_CONF = {
|
|
5
5
|
// By default, Octokit does not retry on 404s.
|
|
6
6
|
// But we want to retry on 404s to account for replication lag.
|
|
7
7
|
doNotRetry: [400, 401, 403, 422],
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
module.exports = {RETRY_CONF};
|
package/lib/fail.js
CHANGED
|
@@ -1,42 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const parseGithubUrl = require('./parse-github-url');
|
|
4
|
-
const {ISSUE_ID} = require('./definitions/constants');
|
|
5
|
-
const resolveConfig = require('./resolve-config');
|
|
6
|
-
const getClient = require('./get-client');
|
|
7
|
-
const findSRIssues = require('./find-sr-issues');
|
|
8
|
-
const getFailComment = require('./get-fail-comment');
|
|
1
|
+
import { template } from "lodash-es";
|
|
2
|
+
import debugFactory from "debug";
|
|
9
3
|
|
|
10
|
-
|
|
4
|
+
import parseGithubUrl from "./parse-github-url.js";
|
|
5
|
+
import { ISSUE_ID } from "./definitions/constants.js";
|
|
6
|
+
import resolveConfig from "./resolve-config.js";
|
|
7
|
+
import { toOctokitOptions, SemanticReleaseOctokit } from "./octokit.js";
|
|
8
|
+
import findSRIssues from "./find-sr-issues.js";
|
|
9
|
+
import getFailComment from "./get-fail-comment.js";
|
|
10
|
+
|
|
11
|
+
const debug = debugFactory("semantic-release:github");
|
|
12
|
+
|
|
13
|
+
export default async function fail(pluginConfig, context, { Octokit }) {
|
|
11
14
|
const {
|
|
12
|
-
options: {repositoryUrl},
|
|
15
|
+
options: { repositoryUrl },
|
|
13
16
|
branch,
|
|
14
17
|
errors,
|
|
15
18
|
logger,
|
|
16
19
|
} = context;
|
|
17
|
-
const {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
const {
|
|
21
|
+
githubToken,
|
|
22
|
+
githubUrl,
|
|
23
|
+
githubApiPathPrefix,
|
|
24
|
+
proxy,
|
|
25
|
+
failComment,
|
|
26
|
+
failTitle,
|
|
27
|
+
labels,
|
|
28
|
+
assignees,
|
|
29
|
+
} = resolveConfig(pluginConfig, context);
|
|
21
30
|
|
|
22
31
|
if (failComment === false || failTitle === false) {
|
|
23
|
-
logger.log(
|
|
32
|
+
logger.log("Skip issue creation.");
|
|
24
33
|
} else {
|
|
25
|
-
const octokit =
|
|
34
|
+
const octokit = new Octokit(
|
|
35
|
+
toOctokitOptions({ githubToken, githubUrl, githubApiPathPrefix, proxy })
|
|
36
|
+
);
|
|
26
37
|
// In case the repo changed name, get the new `repo`/`owner` as the search API will not follow redirects
|
|
27
|
-
const {data: repoData} = await octokit.request(
|
|
28
|
-
|
|
29
|
-
|
|
38
|
+
const { data: repoData } = await octokit.request(
|
|
39
|
+
"GET /repos/{owner}/{repo}",
|
|
40
|
+
parseGithubUrl(repositoryUrl)
|
|
41
|
+
);
|
|
42
|
+
const [owner, repo] = repoData.full_name.split("/");
|
|
43
|
+
const body = failComment
|
|
44
|
+
? template(failComment)({ branch, errors })
|
|
45
|
+
: getFailComment(branch, errors);
|
|
30
46
|
const [srIssue] = await findSRIssues(octokit, failTitle, owner, repo);
|
|
31
47
|
|
|
32
48
|
if (srIssue) {
|
|
33
|
-
logger.log(
|
|
34
|
-
const comment = {owner, repo, issue_number: srIssue.number, body};
|
|
35
|
-
debug(
|
|
49
|
+
logger.log("Found existing semantic-release issue #%d.", srIssue.number);
|
|
50
|
+
const comment = { owner, repo, issue_number: srIssue.number, body };
|
|
51
|
+
debug("create comment: %O", comment);
|
|
36
52
|
const {
|
|
37
|
-
data: {html_url: url},
|
|
38
|
-
} = await octokit.request(
|
|
39
|
-
|
|
53
|
+
data: { html_url: url },
|
|
54
|
+
} = await octokit.request(
|
|
55
|
+
"POST /repos/{owner}/{repo}/issues/{issue_number}/comments",
|
|
56
|
+
comment
|
|
57
|
+
);
|
|
58
|
+
logger.log("Added comment to issue #%d: %s.", srIssue.number, url);
|
|
40
59
|
} else {
|
|
41
60
|
const newIssue = {
|
|
42
61
|
owner,
|
|
@@ -46,11 +65,11 @@ module.exports = async (pluginConfig, context) => {
|
|
|
46
65
|
labels: labels || [],
|
|
47
66
|
assignees,
|
|
48
67
|
};
|
|
49
|
-
debug(
|
|
68
|
+
debug("create issue: %O", newIssue);
|
|
50
69
|
const {
|
|
51
|
-
data: {html_url: url, number},
|
|
52
|
-
} = await octokit.request(
|
|
53
|
-
logger.log(
|
|
70
|
+
data: { html_url: url, number },
|
|
71
|
+
} = await octokit.request("POST /repos/{owner}/{repo}/issues", newIssue);
|
|
72
|
+
logger.log("Created issue #%d: %s.", number, url);
|
|
54
73
|
}
|
|
55
74
|
}
|
|
56
|
-
}
|
|
75
|
+
}
|
package/lib/find-sr-issues.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { ISSUE_ID } from "./definitions/constants.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default async (octokit, title, owner, repo) => {
|
|
4
4
|
const {
|
|
5
|
-
data: {items: issues},
|
|
6
|
-
} = await octokit.request(
|
|
5
|
+
data: { items: issues },
|
|
6
|
+
} = await octokit.request("GET /search/issues", {
|
|
7
7
|
q: `in:title+repo:${owner}/${repo}+type:issue+state:open+${title}`,
|
|
8
8
|
});
|
|
9
9
|
|
package/lib/get-error.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
const ERROR_DEFINITIONS = require('./definitions/errors');
|
|
1
|
+
import SemanticReleaseError from "@semantic-release/error";
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import * as ERROR_DEFINITIONS from "./definitions/errors.js";
|
|
4
|
+
|
|
5
|
+
export default function getError(code, ctx = {}) {
|
|
6
|
+
const { message, details } = ERROR_DEFINITIONS[code](ctx);
|
|
6
7
|
return new SemanticReleaseError(message, code, details);
|
|
7
|
-
}
|
|
8
|
+
}
|
package/lib/get-fail-comment.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const HOME_URL =
|
|
1
|
+
const HOME_URL = "https://github.com/semantic-release/semantic-release";
|
|
2
2
|
const FAQ_URL = `${HOME_URL}/blob/caribou/docs/support/FAQ.md`;
|
|
3
3
|
const GET_HELP_URL = `${HOME_URL}#get-help`;
|
|
4
4
|
const USAGE_DOC_URL = `${HOME_URL}/blob/caribou/docs/usage/README.md`;
|
|
@@ -11,13 +11,14 @@ ${
|
|
|
11
11
|
`Unfortunately this error doesn't have any additional information.${
|
|
12
12
|
error.pluginName
|
|
13
13
|
? ` Feel free to kindly ask the author of the \`${error.pluginName}\` plugin to add more helpful information.`
|
|
14
|
-
:
|
|
14
|
+
: ""
|
|
15
15
|
}`
|
|
16
16
|
}`;
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
export default function getFailComment(branch, errors) {
|
|
19
|
+
return `## :rotating_light: The automated release from the \`${
|
|
20
|
+
branch.name
|
|
21
|
+
}\` branch failed. :rotating_light:
|
|
21
22
|
|
|
22
23
|
I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.
|
|
23
24
|
|
|
@@ -26,8 +27,8 @@ You can find below the list of errors reported by **semantic-release**. Each one
|
|
|
26
27
|
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
|
|
27
28
|
|
|
28
29
|
Once all the errors are resolved, **semantic-release** will release your package the next time you push a commit to the \`${
|
|
29
|
-
|
|
30
|
-
}\` branch. You can also manually restart the failed CI job that runs **semantic-release**.
|
|
30
|
+
branch.name
|
|
31
|
+
}\` branch. You can also manually restart the failed CI job that runs **semantic-release**.
|
|
31
32
|
|
|
32
33
|
If you are not sure how to resolve this, here are some links that can help you:
|
|
33
34
|
- [Usage documentation](${USAGE_DOC_URL})
|
|
@@ -38,10 +39,11 @@ If those don’t help, or if this issue is reporting something you think isn’t
|
|
|
38
39
|
|
|
39
40
|
---
|
|
40
41
|
|
|
41
|
-
${errors.map((error) => formatError(error)).join(
|
|
42
|
+
${errors.map((error) => formatError(error)).join("\n\n---\n\n")}
|
|
42
43
|
|
|
43
44
|
---
|
|
44
45
|
|
|
45
46
|
Good luck with your project ✨
|
|
46
47
|
|
|
47
48
|
Your **[semantic-release](${HOME_URL})** bot :package::rocket:`;
|
|
49
|
+
}
|
package/lib/get-release-links.js
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
import { RELEASE_NAME } from "./definitions/constants.js";
|
|
2
2
|
|
|
3
3
|
const linkify = (releaseInfo) =>
|
|
4
4
|
`${
|
|
5
5
|
releaseInfo.url
|
|
6
|
-
? releaseInfo.url.startsWith(
|
|
6
|
+
? releaseInfo.url.startsWith("http")
|
|
7
7
|
? `[${releaseInfo.name}](${releaseInfo.url})`
|
|
8
8
|
: `${releaseInfo.name}: \`${releaseInfo.url}\``
|
|
9
9
|
: `\`${releaseInfo.name}\``
|
|
10
10
|
}`;
|
|
11
11
|
|
|
12
12
|
const filterReleases = (releaseInfos) =>
|
|
13
|
-
releaseInfos.filter(
|
|
13
|
+
releaseInfos.filter(
|
|
14
|
+
(releaseInfo) => releaseInfo.name && releaseInfo.name !== RELEASE_NAME
|
|
15
|
+
);
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
`${
|
|
17
|
+
export default function getReleaseLinks(releaseInfos) {
|
|
18
|
+
return `${
|
|
17
19
|
filterReleases(releaseInfos).length > 0
|
|
18
20
|
? `This release is also available on:\n${filterReleases(releaseInfos)
|
|
19
21
|
.map((releaseInfo) => `- ${linkify(releaseInfo)}`)
|
|
20
|
-
.join(
|
|
21
|
-
:
|
|
22
|
+
.join("\n")}`
|
|
23
|
+
: ""
|
|
22
24
|
}`;
|
|
25
|
+
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
export default function getSearchQueries(base, commits, separator = "+") {
|
|
2
2
|
return commits.reduce((searches, commit) => {
|
|
3
3
|
const lastSearch = searches[searches.length - 1];
|
|
4
4
|
|
|
5
|
-
if (
|
|
5
|
+
if (
|
|
6
|
+
lastSearch &&
|
|
7
|
+
lastSearch.length + commit.length <= 256 - separator.length
|
|
8
|
+
) {
|
|
6
9
|
searches[searches.length - 1] = `${lastSearch}${separator}${commit}`;
|
|
7
10
|
} else {
|
|
8
11
|
searches.push(`${base}${separator}${commit}`);
|
|
@@ -10,4 +13,4 @@ module.exports = (base, commits, separator = '+') => {
|
|
|
10
13
|
|
|
11
14
|
return searches;
|
|
12
15
|
}, []);
|
|
13
|
-
}
|
|
16
|
+
}
|
|
@@ -1,18 +1,25 @@
|
|
|
1
|
-
const HOME_URL =
|
|
1
|
+
const HOME_URL = "https://github.com/semantic-release/semantic-release";
|
|
2
2
|
const linkify = (releaseInfo) =>
|
|
3
|
-
`${
|
|
3
|
+
`${
|
|
4
|
+
releaseInfo.url
|
|
5
|
+
? `[${releaseInfo.name}](${releaseInfo.url})`
|
|
6
|
+
: `\`${releaseInfo.name}\``
|
|
7
|
+
}`;
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
`:tada: This ${
|
|
7
|
-
|
|
8
|
-
} :tada:${
|
|
9
|
+
export default function getSuccessComment(issue, releaseInfos, nextRelease) {
|
|
10
|
+
return `:tada: This ${
|
|
11
|
+
issue.pull_request ? "PR is included" : "issue has been resolved"
|
|
12
|
+
} in version ${nextRelease.version} :tada:${
|
|
9
13
|
releaseInfos.length > 0
|
|
10
14
|
? `\n\nThe release is available on${
|
|
11
15
|
releaseInfos.length === 1
|
|
12
16
|
? ` ${linkify(releaseInfos[0])}`
|
|
13
|
-
: `:\n${releaseInfos
|
|
17
|
+
: `:\n${releaseInfos
|
|
18
|
+
.map((releaseInfo) => `- ${linkify(releaseInfo)}`)
|
|
19
|
+
.join("\n")}`
|
|
14
20
|
}`
|
|
15
|
-
:
|
|
21
|
+
: ""
|
|
16
22
|
}
|
|
17
23
|
|
|
18
24
|
Your **[semantic-release](${HOME_URL})** bot :package::rocket:`;
|
|
25
|
+
}
|