semantic-release 25.0.5 → 25.0.7
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 +36 -30
- package/bin/semantic-release.js +1 -1
- package/index.d.ts +3 -0
- package/lib/definitions/errors.js +53 -33
- package/lib/git.js +13 -11
- package/lib/hide-sensitive.js +14 -1
- package/lib/verify.js +4 -0
- package/package.json +20 -15
- package/docs/README.md +0 -7
- package/docs/developer-guide/README.md +0 -5
- package/docs/developer-guide/js-api.md +0 -294
- package/docs/developer-guide/plugin.md +0 -284
- package/docs/developer-guide/shareable-configuration.md +0 -1
- package/docs/extending/README.md +0 -4
- package/docs/extending/plugins-list.md +0 -233
- package/docs/extending/shareable-configurations-list.md +0 -22
- package/docs/recipes/ci-configurations/README.md +0 -7
- package/docs/recipes/ci-configurations/circleci-workflows.md +0 -49
- package/docs/recipes/ci-configurations/github-actions.md +0 -136
- package/docs/recipes/ci-configurations/gitlab-ci.md +0 -98
- package/docs/recipes/ci-configurations/jenkins-ci.md +0 -61
- package/docs/recipes/ci-configurations/travis.md +0 -97
- package/docs/recipes/git-hosted-services/README.md +0 -3
- package/docs/recipes/git-hosted-services/git-auth-ssh-keys.md +0 -166
- package/docs/recipes/release-workflow/README.md +0 -5
- package/docs/recipes/release-workflow/distribution-channels.md +0 -117
- package/docs/recipes/release-workflow/maintenance-releases.md +0 -157
- package/docs/recipes/release-workflow/pre-releases.md +0 -197
- package/docs/support/FAQ.md +0 -253
- package/docs/support/README.md +0 -7
- package/docs/support/git-version.md +0 -4
- package/docs/support/node-support-policy.md +0 -21
- package/docs/support/node-version.md +0 -38
- package/docs/support/resources.md +0 -22
- package/docs/support/troubleshooting.md +0 -70
- package/docs/usage/README.md +0 -9
- package/docs/usage/ci-configuration.md +0 -50
- package/docs/usage/configuration.md +0 -206
- package/docs/usage/getting-started.md +0 -8
- package/docs/usage/installation.md +0 -51
- package/docs/usage/plugins.md +0 -105
- package/docs/usage/shareable-configurations.md +0 -7
- package/docs/usage/workflow-configuration.md +0 -199
package/README.md
CHANGED
|
@@ -40,10 +40,10 @@ This removes the immediate connection between human emotions and version numbers
|
|
|
40
40
|
- Notify maintainers and users of new releases
|
|
41
41
|
- Use formalized commit message convention to document changes in the codebase
|
|
42
42
|
- Publish on different distribution channels (such as [npm dist-tags](https://docs.npmjs.com/cli/dist-tag)) based on git merges
|
|
43
|
-
- Integrate with your [continuous integration workflow](
|
|
43
|
+
- Integrate with your [continuous integration workflow](https://semantic-release.org/recipes/ci-configurations/#ci-configurations)
|
|
44
44
|
- Avoid potential errors associated with manual releases
|
|
45
|
-
- Support any [package managers and languages](
|
|
46
|
-
- Simple and reusable configuration via [shareable configurations](
|
|
45
|
+
- Support any [package managers and languages](https://semantic-release.org/recipes/release-workflow/#package-managers-and-languages) via [plugins](https://semantic-release.org/foundation/plugins/)
|
|
46
|
+
- Simple and reusable configuration via [shareable configurations](https://semantic-release.org/foundation/shareable-configurations/)
|
|
47
47
|
- Support for [npm package provenance](https://github.com/semantic-release/npm#npm-provenance) that promotes increased supply-chain security via signed attestations on GitHub Actions
|
|
48
48
|
|
|
49
49
|
## How does it work?
|
|
@@ -54,7 +54,7 @@ This removes the immediate connection between human emotions and version numbers
|
|
|
54
54
|
Following formalized conventions for commit messages, **semantic-release** automatically determines the next [semantic version](https://semver.org) number, generates a changelog and publishes the release.
|
|
55
55
|
|
|
56
56
|
By default, **semantic-release** uses [Angular Commit Message Conventions](https://github.com/angular/angular/blob/main/contributing-docs/commit-message-guidelines.md).
|
|
57
|
-
The commit message format can be changed with the [`preset` or `config` options](
|
|
57
|
+
The commit message format can be changed with the [`preset` or `config` options](https://semantic-release.org/usage/configuration/#options) of the [@semantic-release/commit-analyzer](https://github.com/semantic-release/commit-analyzer#options) and [@semantic-release/release-notes-generator](https://github.com/semantic-release/release-notes-generator#options) plugins.
|
|
58
58
|
|
|
59
59
|
Tools such as [commitizen](https://github.com/commitizen/cz-cli) or [commitlint](https://github.com/conventional-changelog/commitlint) can be used to help contributors and enforce valid commit messages.
|
|
60
60
|
|
|
@@ -78,9 +78,9 @@ For each new commit added to one of the release branches (for example: `master`,
|
|
|
78
78
|
**semantic-release** offers various ways to control the timing, the content and the audience of published releases.
|
|
79
79
|
See example workflows in the following recipes:
|
|
80
80
|
|
|
81
|
-
- [Using distribution channels](
|
|
82
|
-
- [Maintenance releases](
|
|
83
|
-
- [Pre-releases](
|
|
81
|
+
- [Using distribution channels](https://semantic-release.org/recipes/release-workflow/distribution-channels/#publishing-on-distribution-channels)
|
|
82
|
+
- [Maintenance releases](https://semantic-release.org/recipes/release-workflow/maintenance-releases/#publishing-maintenance-releases)
|
|
83
|
+
- [Pre-releases](https://semantic-release.org/recipes/release-workflow/pre-releases/#publishing-pre-releases)
|
|
84
84
|
|
|
85
85
|
### Release steps
|
|
86
86
|
|
|
@@ -103,37 +103,43 @@ After running the tests, the command `semantic-release` will execute the followi
|
|
|
103
103
|
In order to use **semantic-release** you need:
|
|
104
104
|
|
|
105
105
|
- To host your code in a [Git repository](https://git-scm.com)
|
|
106
|
-
- Use a Continuous Integration service that allows you to [securely set up credentials](
|
|
107
|
-
- A Git CLI version that meets [our version requirement](
|
|
108
|
-
- A [Node.js](https://nodejs.org) version that meets [our version requirement](
|
|
106
|
+
- Use a Continuous Integration service that allows you to [securely set up credentials](https://semantic-release.org/usage/ci-configuration/#authentication)
|
|
107
|
+
- A Git CLI version that meets [our version requirement](https://semantic-release.org/support/git-version/) installed in your Continuous Integration environment
|
|
108
|
+
- A [Node.js](https://nodejs.org) version that meets [our version requirement](https://semantic-release.org/support/node-version/) installed in your Continuous Integration environment
|
|
109
109
|
|
|
110
110
|
## Documentation
|
|
111
111
|
|
|
112
112
|
- Usage
|
|
113
|
-
- [Getting started](
|
|
114
|
-
- [
|
|
115
|
-
- [CI Configuration](
|
|
116
|
-
- [
|
|
117
|
-
|
|
118
|
-
- [
|
|
119
|
-
- [
|
|
113
|
+
- [Getting started](https://semantic-release.org/usage/getting-started/)
|
|
114
|
+
- [Configuration](https://semantic-release.org/usage/configuration/)
|
|
115
|
+
- [CI Configuration](https://semantic-release.org/usage/ci-configuration/)
|
|
116
|
+
- [Running semantic-release](https://semantic-release.org/usage/running/)
|
|
117
|
+
- Foundations
|
|
118
|
+
- [How it works](https://semantic-release.org/foundation/how-it-works/)
|
|
119
|
+
- [Release Steps](https://semantic-release.org/foundation/release-steps/)
|
|
120
|
+
- [Considerations](https://semantic-release.org/foundation/considerations/)
|
|
121
|
+
- [Supported Branching Models](https://semantic-release.org/foundation/supported-branching/)
|
|
122
|
+
- [Release Workflow configuration](https://semantic-release.org/foundation/workflow-configuration/)
|
|
123
|
+
- [Plugins](https://semantic-release.org/foundation/plugins/)
|
|
124
|
+
- [Shareable configurations](https://semantic-release.org/foundation/shareable-configurations/)
|
|
120
125
|
- Extending
|
|
121
|
-
- [Plugins](
|
|
122
|
-
- [Shareable configuration](
|
|
126
|
+
- [Plugins](https://semantic-release.org/extending/plugins-list/)
|
|
127
|
+
- [Shareable configuration](https://semantic-release.org/extending/shareable-configurations-list/)
|
|
123
128
|
- Recipes
|
|
124
|
-
- [CI configurations](
|
|
125
|
-
- [Git hosted services](
|
|
126
|
-
- [Release workflow](
|
|
129
|
+
- [CI configurations](https://semantic-release.org/recipes/ci-configurations/)
|
|
130
|
+
- [Git hosted services](https://semantic-release.org/recipes/git-hosted-services/)
|
|
131
|
+
- [Release workflow](https://semantic-release.org/recipes/release-workflow/)
|
|
127
132
|
- Developer guide
|
|
128
|
-
- [JavaScript API](
|
|
129
|
-
- [Plugins development](
|
|
130
|
-
- [Shareable configuration development](
|
|
133
|
+
- [JavaScript API](https://semantic-release.org/developer-guide/js-api/)
|
|
134
|
+
- [Plugins development](https://semantic-release.org/developer-guide/plugin/)
|
|
135
|
+
- [Shareable configuration development](https://semantic-release.org/developer-guide/shareable-configuration/)
|
|
131
136
|
- Support
|
|
132
|
-
- [Resources](
|
|
133
|
-
- [Frequently Asked Questions](
|
|
134
|
-
- [Troubleshooting](
|
|
135
|
-
- [Node version requirement](
|
|
136
|
-
- [Node Support Policy](
|
|
137
|
+
- [Resources](https://semantic-release.org/support/resources/)
|
|
138
|
+
- [Frequently Asked Questions](https://semantic-release.org/support/faq/)
|
|
139
|
+
- [Troubleshooting](https://semantic-release.org/support/troubleshooting/)
|
|
140
|
+
- [Node version requirement](https://semantic-release.org/support/node-version/)
|
|
141
|
+
- [Node Support Policy](https://semantic-release.org/support/node-support-policy/)
|
|
142
|
+
- [Git Version requirement](https://semantic-release.org/support/git-version/)
|
|
137
143
|
|
|
138
144
|
## Get help
|
|
139
145
|
|
package/bin/semantic-release.js
CHANGED
|
@@ -18,7 +18,7 @@ if (!satisfies(process.version, engines.node)) {
|
|
|
18
18
|
console.error(
|
|
19
19
|
`[semantic-release]: node version ${engines.node} is required. Found ${process.version}.
|
|
20
20
|
|
|
21
|
-
See https://
|
|
21
|
+
See https://semantic-release.org/support/node-version/ for more details and solutions.`
|
|
22
22
|
);
|
|
23
23
|
process.exit(1);
|
|
24
24
|
}
|
package/index.d.ts
CHANGED
|
@@ -627,6 +627,9 @@ declare module "semantic-release" {
|
|
|
627
627
|
* Any valid git url format is supported (see
|
|
628
628
|
* [git protocols](https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols))
|
|
629
629
|
*
|
|
630
|
+
* The value must not begin with `-`, as it would otherwise be interpreted
|
|
631
|
+
* by `git` as a command-line option rather than a URL.
|
|
632
|
+
*
|
|
630
633
|
* Default: `repository` property in `package.json`, or git origin url.
|
|
631
634
|
*/
|
|
632
635
|
repositoryUrl?: string | undefined;
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { inspect } from "node:util";
|
|
2
|
-
import { createRequire } from "node:module";
|
|
3
2
|
import { isString, toLower, trim } from "lodash-es";
|
|
4
3
|
import { RELEASE_TYPE } from "./constants.js";
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import pkg from "../../package.json" with { type: "json" };
|
|
6
|
+
|
|
7
|
+
const DOCS_URL = "https://semantic-release.org";
|
|
8
8
|
|
|
9
|
-
const [homepage] = pkg.homepage.split("#");
|
|
10
9
|
const stringify = (object) =>
|
|
11
10
|
isString(object) ? object : inspect(object, { breakLength: Infinity, depth: 2, maxArrayLength: 5 });
|
|
12
|
-
|
|
11
|
+
|
|
12
|
+
const linkify = (file) => {
|
|
13
|
+
const [path, hash] = file.split("#");
|
|
14
|
+
|
|
15
|
+
return `${DOCS_URL}/${path.replace(/\.md$/u, "")}${hash ? `#${hash}` : ""}`;
|
|
16
|
+
};
|
|
17
|
+
|
|
13
18
|
const wordsList = (words) =>
|
|
14
19
|
`${words.slice(0, -1).join(", ")}${words.length > 1 ? ` or ${words[words.length - 1]}` : trim(words[0])}`;
|
|
15
20
|
|
|
@@ -28,25 +33,40 @@ export function ENOREPOURL() {
|
|
|
28
33
|
return {
|
|
29
34
|
message: "The `repositoryUrl` option is required.",
|
|
30
35
|
details: `The [repositoryUrl option](${linkify(
|
|
31
|
-
"
|
|
36
|
+
"usage/configuration#repositoryurl"
|
|
32
37
|
)}) cannot be determined from the semantic-release configuration, the \`package.json\` nor the [git origin url](https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes).
|
|
33
38
|
|
|
34
|
-
Please make sure to add the \`repositoryUrl\` to the [semantic-release configuration]
|
|
35
|
-
"
|
|
39
|
+
Please make sure to add the \`repositoryUrl\` to the [semantic-release configuration](${linkify(
|
|
40
|
+
"usage/configuration#repositoryurl"
|
|
36
41
|
)}).`,
|
|
37
42
|
};
|
|
38
43
|
}
|
|
39
44
|
|
|
45
|
+
export function EINVALIDREPOURL({ repositoryUrl }) {
|
|
46
|
+
return {
|
|
47
|
+
message: "The `repositoryUrl` option is not a valid git URL.",
|
|
48
|
+
details: `The [repositoryUrl option](${linkify(
|
|
49
|
+
"usage/configuration#repositoryurl"
|
|
50
|
+
)}) must be a valid git URL and cannot begin with \`-\`, as \`git\` would otherwise interpret it as a command-line option rather than a URL.
|
|
51
|
+
|
|
52
|
+
The invalid \`repositoryUrl\` is \`${repositoryUrl}\`.
|
|
53
|
+
|
|
54
|
+
Please verify the \`repository\` property in your \`package.json\` and the [repositoryUrl option](${linkify(
|
|
55
|
+
"usage/configuration#repositoryurl"
|
|
56
|
+
)}) in your [semantic-release configuration](${linkify("usage/configuration#configuration")}).`,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
40
60
|
export function EGITNOPERMISSION({ options: { repositoryUrl }, branch: { name } }) {
|
|
41
61
|
return {
|
|
42
62
|
message: "Cannot push to the Git repository.",
|
|
43
63
|
details: `**semantic-release** cannot push the version tag to the branch \`${name}\` on the remote Git repository with URL \`${repositoryUrl}\`.
|
|
44
64
|
|
|
45
65
|
This can be caused by:
|
|
46
|
-
- a misconfiguration of the [repositoryUrl](${linkify("
|
|
66
|
+
- a misconfiguration of the [repositoryUrl](${linkify("usage/configuration#repositoryurl")}) option
|
|
47
67
|
- the repository being unavailable
|
|
48
68
|
- or missing push permission for the user configured via the [Git credentials on your CI environment](${linkify(
|
|
49
|
-
"
|
|
69
|
+
"usage/ci-configuration#authentication"
|
|
50
70
|
)})`,
|
|
51
71
|
};
|
|
52
72
|
}
|
|
@@ -55,7 +75,7 @@ export function EINVALIDTAGFORMAT({ options: { tagFormat } }) {
|
|
|
55
75
|
return {
|
|
56
76
|
message: "Invalid `tagFormat` option.",
|
|
57
77
|
details: `The [tagFormat](${linkify(
|
|
58
|
-
"
|
|
78
|
+
"usage/configuration#tagformat"
|
|
59
79
|
)}) must compile to a [valid Git reference](https://git-scm.com/docs/git-check-ref-format#_description).
|
|
60
80
|
|
|
61
81
|
Your configuration for the \`tagFormat\` option is \`${stringify(tagFormat)}\`.`,
|
|
@@ -66,7 +86,7 @@ export function ETAGNOVERSION({ options: { tagFormat } }) {
|
|
|
66
86
|
return {
|
|
67
87
|
message: "Invalid `tagFormat` option.",
|
|
68
88
|
details: `The [tagFormat](${linkify(
|
|
69
|
-
"
|
|
89
|
+
"usage/configuration#tagformat"
|
|
70
90
|
)}) option must contain the variable \`version\` exactly once.
|
|
71
91
|
|
|
72
92
|
Your configuration for the \`tagFormat\` option is \`${stringify(tagFormat)}\`.`,
|
|
@@ -76,7 +96,7 @@ Your configuration for the \`tagFormat\` option is \`${stringify(tagFormat)}\`.`
|
|
|
76
96
|
export function EPLUGINCONF({ type, required, pluginConf }) {
|
|
77
97
|
return {
|
|
78
98
|
message: `The \`${type}\` plugin configuration is invalid.`,
|
|
79
|
-
details: `The [${type} plugin configuration](${linkify(`
|
|
99
|
+
details: `The [${type} plugin configuration](${linkify(`foundation/plugins#${toLower(type)}-plugin`)}) ${
|
|
80
100
|
required ? "is required and " : ""
|
|
81
101
|
} must be a single or an array of plugins definition. A plugin definition is an npm module name, optionally wrapped in an array with an object.
|
|
82
102
|
|
|
@@ -88,7 +108,7 @@ export function EPLUGINSCONF({ plugin }) {
|
|
|
88
108
|
return {
|
|
89
109
|
message: "The `plugins` configuration is invalid.",
|
|
90
110
|
details: `The [plugins](${linkify(
|
|
91
|
-
"
|
|
111
|
+
"usage/configuration#plugins"
|
|
92
112
|
)}) option must be an array of plugin definitions. A plugin definition is an npm module name, optionally wrapped in an array with an object.
|
|
93
113
|
|
|
94
114
|
The invalid configuration is \`${stringify(plugin)}\`.`,
|
|
@@ -103,7 +123,7 @@ export function EPLUGIN({ pluginName, type }) {
|
|
|
103
123
|
The plugin \`${pluginName}\` doesn't have the property \`${type}\` and cannot be used for the \`${type}\` step.
|
|
104
124
|
|
|
105
125
|
Please refer to the \`${pluginName}\` and [semantic-release plugins configuration](${linkify(
|
|
106
|
-
"
|
|
126
|
+
"foundation/plugins/#plugin-options-configuration"
|
|
107
127
|
)}) documentation for more details.`,
|
|
108
128
|
};
|
|
109
129
|
}
|
|
@@ -121,8 +141,8 @@ We recommend to report the issue to the \`${pluginName}\` authors, providing the
|
|
|
121
141
|
- The **semantic-release** version: \`${pkg.version}\`
|
|
122
142
|
- The **semantic-release** logs from your CI job
|
|
123
143
|
- The value returned by the plugin: \`${stringify(result)}\`
|
|
124
|
-
- A link to the **semantic-release** plugin developer guide: [${linkify("
|
|
125
|
-
"
|
|
144
|
+
- A link to the **semantic-release** plugin developer guide: [${linkify("developer-guide/plugin")}](${linkify(
|
|
145
|
+
"developer-guide/plugin"
|
|
126
146
|
)})`,
|
|
127
147
|
};
|
|
128
148
|
}
|
|
@@ -138,8 +158,8 @@ We recommend to report the issue to the \`${pluginName}\` authors, providing the
|
|
|
138
158
|
- The **semantic-release** version: \`${pkg.version}\`
|
|
139
159
|
- The **semantic-release** logs from your CI job
|
|
140
160
|
- The value returned by the plugin: \`${stringify(result)}\`
|
|
141
|
-
- A link to the **semantic-release** plugin developer guide: [${linkify("
|
|
142
|
-
"
|
|
161
|
+
- A link to the **semantic-release** plugin developer guide: [${linkify("developer-guide/plugin")}](${linkify(
|
|
162
|
+
"developer-guide/plugin"
|
|
143
163
|
)})`,
|
|
144
164
|
};
|
|
145
165
|
}
|
|
@@ -155,8 +175,8 @@ We recommend to report the issue to the \`${pluginName}\` authors, providing the
|
|
|
155
175
|
- The **semantic-release** version: \`${pkg.version}\`
|
|
156
176
|
- The **semantic-release** logs from your CI job
|
|
157
177
|
- The value returned by the plugin: \`${stringify(result)}\`
|
|
158
|
-
- A link to the **semantic-release** plugin developer guide: [${linkify("
|
|
159
|
-
"
|
|
178
|
+
- A link to the **semantic-release** plugin developer guide: [${linkify("developer-guide/plugin")}](${linkify(
|
|
179
|
+
"developer-guide/plugin"
|
|
160
180
|
)})`,
|
|
161
181
|
};
|
|
162
182
|
}
|
|
@@ -172,8 +192,8 @@ We recommend to report the issue to the \`${pluginName}\` authors, providing the
|
|
|
172
192
|
- The **semantic-release** version: \`${pkg.version}\`
|
|
173
193
|
- The **semantic-release** logs from your CI job
|
|
174
194
|
- The value returned by the plugin: \`${stringify(result)}\`
|
|
175
|
-
- A link to the **semantic-release** plugin developer guide: [${linkify("
|
|
176
|
-
"
|
|
195
|
+
- A link to the **semantic-release** plugin developer guide: [${linkify("developer-guide/plugin")}](${linkify(
|
|
196
|
+
"developer-guide/plugin"
|
|
177
197
|
)})`,
|
|
178
198
|
};
|
|
179
199
|
}
|
|
@@ -182,7 +202,7 @@ export function EINVALIDBRANCH({ branch }) {
|
|
|
182
202
|
return {
|
|
183
203
|
message: "A branch is invalid in the `branches` configuration.",
|
|
184
204
|
details: `Each branch in the [branches configuration](${linkify(
|
|
185
|
-
"
|
|
205
|
+
"usage/configuration#branches"
|
|
186
206
|
)}) must be either a string, a regexp or an object with a \`name\` property.
|
|
187
207
|
|
|
188
208
|
Your configuration for the problematic branch is \`${stringify(branch)}\`.`,
|
|
@@ -193,7 +213,7 @@ export function EINVALIDBRANCHNAME({ branch }) {
|
|
|
193
213
|
return {
|
|
194
214
|
message: "A branch name is invalid in the `branches` configuration.",
|
|
195
215
|
details: `Each branch in the [branches configuration](${linkify(
|
|
196
|
-
"
|
|
216
|
+
"usage/configuration#branches"
|
|
197
217
|
)}) must be a [valid Git reference](https://git-scm.com/docs/git-check-ref-format#_description).
|
|
198
218
|
|
|
199
219
|
Your configuration for the problematic branch is \`${stringify(branch)}\`.`,
|
|
@@ -204,7 +224,7 @@ export function EDUPLICATEBRANCHES({ duplicates }) {
|
|
|
204
224
|
return {
|
|
205
225
|
message: "The `branches` configuration has duplicate branches.",
|
|
206
226
|
details: `Each branch in the [branches configuration](${linkify(
|
|
207
|
-
"
|
|
227
|
+
"usage/configuration#branches"
|
|
208
228
|
)}) must havea unique name.
|
|
209
229
|
|
|
210
230
|
Your configuration contains duplicates for the following branch names: \`${stringify(duplicates)}\`.`,
|
|
@@ -215,7 +235,7 @@ export function EMAINTENANCEBRANCH({ branch }) {
|
|
|
215
235
|
return {
|
|
216
236
|
message: "A maintenance branch is invalid in the `branches` configuration.",
|
|
217
237
|
details: `Each maintenance branch in the [branches configuration](${linkify(
|
|
218
|
-
"
|
|
238
|
+
"usage/configuration#branches"
|
|
219
239
|
)}) must have a \`range\` property formatted like \`N.x\`, \`N.x.x\` or \`N.N.x\` (\`N\` is a number).
|
|
220
240
|
|
|
221
241
|
Your configuration for the problematic branch is \`${stringify(branch)}\`.`,
|
|
@@ -226,7 +246,7 @@ export function EMAINTENANCEBRANCHES({ branches }) {
|
|
|
226
246
|
return {
|
|
227
247
|
message: "The maintenance branches are invalid in the `branches` configuration.",
|
|
228
248
|
details: `Each maintenance branch in the [branches configuration](${linkify(
|
|
229
|
-
"
|
|
249
|
+
"usage/configuration#branches"
|
|
230
250
|
)}) must have a unique \`range\` property and must exist on the remote repository.
|
|
231
251
|
|
|
232
252
|
Your configuration for the problematic branches is \`${stringify(branches)}\`.`,
|
|
@@ -237,7 +257,7 @@ export function ERELEASEBRANCHES({ branches }) {
|
|
|
237
257
|
return {
|
|
238
258
|
message: "The release branches are invalid in the `branches` configuration.",
|
|
239
259
|
details: `A minimum of 1 and a maximum of 3 release branches are required in the [branches configuration](${linkify(
|
|
240
|
-
"
|
|
260
|
+
"usage/configuration#branches"
|
|
241
261
|
)}). These branches must exist on the remote repository.
|
|
242
262
|
|
|
243
263
|
This may occur if your repository does not have a release branch, such as \`master\` or \`main\`.
|
|
@@ -250,7 +270,7 @@ export function EPRERELEASEBRANCH({ branch }) {
|
|
|
250
270
|
return {
|
|
251
271
|
message: "A pre-release branch configuration is invalid in the `branches` configuration.",
|
|
252
272
|
details: `Each pre-release branch in the [branches configuration](${linkify(
|
|
253
|
-
"
|
|
273
|
+
"usage/configuration#branches"
|
|
254
274
|
)}) must have a \`prerelease\` property valid per the [Semantic Versioning Specification](https://semver.org/#spec-item-9). If the \`prerelease\` property is set to \`true\`, then the \`name\` property is used instead. Additionally, each pre-release branch must exist on the remote repository.
|
|
255
275
|
|
|
256
276
|
Your configuration for the problematic branch is \`${stringify(branch)}\`.`,
|
|
@@ -261,7 +281,7 @@ export function EPRERELEASEBRANCHES({ branches }) {
|
|
|
261
281
|
return {
|
|
262
282
|
message: "The pre-release branches are invalid in the `branches` configuration.",
|
|
263
283
|
details: `Each pre-release branch in the [branches configuration](${linkify(
|
|
264
|
-
"
|
|
284
|
+
"usage/configuration#branches"
|
|
265
285
|
)}) must have a unique \`prerelease\` property. If the \`prerelease\` property is set to \`true\`, then the \`name\` property is used instead.
|
|
266
286
|
|
|
267
287
|
Your configuration for the problematic branches is \`${stringify(branches)}\`.`,
|
|
@@ -282,7 +302,7 @@ ${
|
|
|
282
302
|
|
|
283
303
|
A valid branch could be ${wordsList(validBranches.map(({ name }) => `\`${name}\``))}.
|
|
284
304
|
|
|
285
|
-
See the [workflow configuration documentation](${linkify("
|
|
305
|
+
See the [workflow configuration documentation](${linkify("foundation/workflow-configuration")}) for more details.`,
|
|
286
306
|
};
|
|
287
307
|
}
|
|
288
308
|
|
|
@@ -293,6 +313,6 @@ export function EINVALIDMAINTENANCEMERGE({ nextRelease: { channel, gitTag, versi
|
|
|
293
313
|
|
|
294
314
|
The branch \`${name}\` head should be [reset](https://git-scm.com/docs/git-reset) to a previous commit so the commit with tag \`${gitTag}\` is removed from the branch history.
|
|
295
315
|
|
|
296
|
-
See the [workflow configuration documentation](${linkify("
|
|
316
|
+
See the [workflow configuration documentation](${linkify("foundation/workflow-configuration")}) for more details.`,
|
|
297
317
|
};
|
|
298
318
|
}
|
package/lib/git.js
CHANGED
|
@@ -67,7 +67,7 @@ export async function getCommits(from, to, execaOptions) {
|
|
|
67
67
|
* @throws {Error} If the `git` command fails.
|
|
68
68
|
*/
|
|
69
69
|
export async function getBranches(repositoryUrl, execaOptions) {
|
|
70
|
-
return (await execa("git", ["ls-remote", "--heads", repositoryUrl], execaOptions)).stdout
|
|
70
|
+
return (await execa("git", ["ls-remote", "--heads", "--", repositoryUrl], execaOptions)).stdout
|
|
71
71
|
.split("\n")
|
|
72
72
|
.filter(Boolean)
|
|
73
73
|
.map((branch) => branch.match(/^.+refs\/heads\/(?<branch>.+)$/)[1]);
|
|
@@ -115,8 +115,8 @@ export async function fetch(repositoryUrl, branch, ciBranch, execaOptions) {
|
|
|
115
115
|
"--unshallow",
|
|
116
116
|
"--tags",
|
|
117
117
|
...(branch === ciBranch && !isDetachedHead
|
|
118
|
-
? [repositoryUrl]
|
|
119
|
-
: ["--update-head-ok", repositoryUrl, `+refs/heads/${branch}:refs/heads/${branch}`]),
|
|
118
|
+
? ["--", repositoryUrl]
|
|
119
|
+
: ["--update-head-ok", "--", repositoryUrl, `+refs/heads/${branch}:refs/heads/${branch}`]),
|
|
120
120
|
],
|
|
121
121
|
execaOptions
|
|
122
122
|
);
|
|
@@ -127,8 +127,8 @@ export async function fetch(repositoryUrl, branch, ciBranch, execaOptions) {
|
|
|
127
127
|
"fetch",
|
|
128
128
|
"--tags",
|
|
129
129
|
...(branch === ciBranch && !isDetachedHead
|
|
130
|
-
? [repositoryUrl]
|
|
131
|
-
: ["--update-head-ok", repositoryUrl, `+refs/heads/${branch}:refs/heads/${branch}`]),
|
|
130
|
+
? ["--", repositoryUrl]
|
|
131
|
+
: ["--update-head-ok", "--", repositoryUrl, `+refs/heads/${branch}:refs/heads/${branch}`]),
|
|
132
132
|
],
|
|
133
133
|
execaOptions
|
|
134
134
|
);
|
|
@@ -143,9 +143,9 @@ export async function fetch(repositoryUrl, branch, ciBranch, execaOptions) {
|
|
|
143
143
|
*/
|
|
144
144
|
export async function fetchNotes(repositoryUrl, execaOptions) {
|
|
145
145
|
try {
|
|
146
|
-
await execa("git", ["fetch", "--unshallow", repositoryUrl, `+refs/notes/*:refs/notes/*`], execaOptions);
|
|
146
|
+
await execa("git", ["fetch", "--unshallow", "--", repositoryUrl, `+refs/notes/*:refs/notes/*`], execaOptions);
|
|
147
147
|
} catch {
|
|
148
|
-
await execa("git", ["fetch", repositoryUrl, `+refs/notes/*:refs/notes/*`], {
|
|
148
|
+
await execa("git", ["fetch", "--", repositoryUrl, `+refs/notes/*:refs/notes/*`], {
|
|
149
149
|
...execaOptions,
|
|
150
150
|
reject: false,
|
|
151
151
|
});
|
|
@@ -204,7 +204,7 @@ export async function isGitRepo(execaOptions) {
|
|
|
204
204
|
*/
|
|
205
205
|
export async function verifyAuth(repositoryUrl, branch, execaOptions) {
|
|
206
206
|
try {
|
|
207
|
-
await execa("git", ["push", "--dry-run", "--no-verify", repositoryUrl, `HEAD:${branch}`], execaOptions);
|
|
207
|
+
await execa("git", ["push", "--dry-run", "--no-verify", "--", repositoryUrl, `HEAD:${branch}`], execaOptions);
|
|
208
208
|
} catch (error) {
|
|
209
209
|
debug(error);
|
|
210
210
|
throw error;
|
|
@@ -233,7 +233,7 @@ export async function tag(tagName, ref, execaOptions) {
|
|
|
233
233
|
* @throws {Error} if the push failed.
|
|
234
234
|
*/
|
|
235
235
|
export async function push(repositoryUrl, execaOptions) {
|
|
236
|
-
await execa("git", ["push", "--tags", repositoryUrl], execaOptions);
|
|
236
|
+
await execa("git", ["push", "--tags", "--", repositoryUrl], execaOptions);
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
/**
|
|
@@ -245,7 +245,7 @@ export async function push(repositoryUrl, execaOptions) {
|
|
|
245
245
|
* @throws {Error} if the push failed.
|
|
246
246
|
*/
|
|
247
247
|
export async function pushNotes(repositoryUrl, ref, execaOptions) {
|
|
248
|
-
await execa("git", ["push", repositoryUrl, `refs/notes/${GIT_NOTE_REF}-${ref}`], execaOptions);
|
|
248
|
+
await execa("git", ["push", "--", repositoryUrl, `refs/notes/${GIT_NOTE_REF}-${ref}`], execaOptions);
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
/**
|
|
@@ -292,7 +292,9 @@ export async function verifyBranchName(branch, execaOptions) {
|
|
|
292
292
|
export async function isBranchUpToDate(repositoryUrl, branch, execaOptions) {
|
|
293
293
|
return (
|
|
294
294
|
(await getGitHead(execaOptions)) ===
|
|
295
|
-
(await execa("git", ["ls-remote", "--heads", repositoryUrl, branch], execaOptions)).stdout.match(
|
|
295
|
+
(await execa("git", ["ls-remote", "--heads", "--", repositoryUrl, branch], execaOptions)).stdout.match(
|
|
296
|
+
/^(?<ref>\w+)?/
|
|
297
|
+
)[1]
|
|
296
298
|
);
|
|
297
299
|
}
|
|
298
300
|
|
package/lib/hide-sensitive.js
CHANGED
|
@@ -12,7 +12,20 @@ export default (env) => {
|
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
const regexp = new RegExp(
|
|
15
|
-
toReplace
|
|
15
|
+
toReplace
|
|
16
|
+
.flatMap((envVar) => {
|
|
17
|
+
const value = env[envVar];
|
|
18
|
+
const forms = new Set([
|
|
19
|
+
value,
|
|
20
|
+
encodeURI(value),
|
|
21
|
+
encodeURIComponent(value),
|
|
22
|
+
// The form emitted by `url.format()`, which `get-git-auth-url.js` uses to embed credentials
|
|
23
|
+
// in the repository URL: like `encodeURIComponent()`, but `:` separators are kept as is
|
|
24
|
+
value.split(":").map(encodeURIComponent).join(":"),
|
|
25
|
+
]);
|
|
26
|
+
return [...forms].map(escapeRegExp);
|
|
27
|
+
})
|
|
28
|
+
.join("|"),
|
|
16
29
|
"g"
|
|
17
30
|
);
|
|
18
31
|
return (output) =>
|
package/lib/verify.js
CHANGED
|
@@ -15,6 +15,10 @@ export default async (context) => {
|
|
|
15
15
|
errors.push(getError("ENOGITREPO", { cwd }));
|
|
16
16
|
} else if (!repositoryUrl) {
|
|
17
17
|
errors.push(getError("ENOREPOURL"));
|
|
18
|
+
} else if (repositoryUrl.startsWith("-")) {
|
|
19
|
+
// A `repositoryUrl` beginning with `-` would be interpreted by `git` as a
|
|
20
|
+
// command-line option rather than a URL, enabling argument injection.
|
|
21
|
+
errors.push(getError("EINVALIDREPOURL", { repositoryUrl }));
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
// Verify that compiling the `tagFormat` produce a valid Git tag
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "semantic-release",
|
|
3
3
|
"description": "Automated semver compliant package publishing",
|
|
4
|
-
"version": "25.0.
|
|
4
|
+
"version": "25.0.7",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Stephan Bönnemann <stephan@boennemann.me> (http://boennemann.me)",
|
|
7
7
|
"ava": {
|
|
@@ -57,28 +57,28 @@
|
|
|
57
57
|
"yargs": "^18.0.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@types/node": "24.
|
|
60
|
+
"@types/node": "24.13.3",
|
|
61
61
|
"@types/signale": "1.4.7",
|
|
62
62
|
"ava": "8.0.1",
|
|
63
63
|
"c8": "11.0.0",
|
|
64
64
|
"clear-module": "4.1.3",
|
|
65
65
|
"cz-conventional-changelog": "3.3.0",
|
|
66
|
-
"dockerode": "5.0.0",
|
|
67
66
|
"file-url": "4.0.0",
|
|
68
|
-
"fs-extra": "11.3.
|
|
69
|
-
"got": "15.0
|
|
70
|
-
"js-yaml": "4.
|
|
67
|
+
"fs-extra": "11.3.6",
|
|
68
|
+
"got": "15.1.0",
|
|
69
|
+
"js-yaml": "4.3.0",
|
|
71
70
|
"lockfile-lint": "5.0.0",
|
|
72
|
-
"ls-engines": "0.10.
|
|
73
|
-
"mockserver-client": "
|
|
74
|
-
"nock": "14.0.
|
|
75
|
-
"npm-run-all2": "9.0.
|
|
71
|
+
"ls-engines": "0.10.1",
|
|
72
|
+
"mockserver-client": "7.4.0",
|
|
73
|
+
"nock": "14.0.16",
|
|
74
|
+
"npm-run-all2": "9.0.2",
|
|
76
75
|
"p-retry": "8.0.0",
|
|
77
|
-
"prettier": "3.8.
|
|
76
|
+
"prettier": "3.8.5",
|
|
78
77
|
"publint": "0.3.21",
|
|
79
78
|
"sinon": "22.0.0",
|
|
80
79
|
"stream-buffers": "3.0.3",
|
|
81
80
|
"tempy": "3.2.0",
|
|
81
|
+
"testcontainers": "12.0.4",
|
|
82
82
|
"testdouble": "3.20.2"
|
|
83
83
|
},
|
|
84
84
|
"engines": {
|
|
@@ -146,8 +146,8 @@
|
|
|
146
146
|
}
|
|
147
147
|
},
|
|
148
148
|
"scripts": {
|
|
149
|
-
"lint:prettier": "prettier --check \"*.{js,json,md}\" \".github/**/*.{md,yml}\" \"
|
|
150
|
-
"lint:prettier:fix": "prettier --write \"*.{js,json,md}\" \".github/**/*.{md,yml}\" \"
|
|
149
|
+
"lint:prettier": "prettier --check \"*.{js,json,md}\" \".github/**/*.{md,yml}\" \"{bin,lib,test}/**/*.js\"",
|
|
150
|
+
"lint:prettier:fix": "prettier --write \"*.{js,json,md}\" \".github/**/*.{md,yml}\" \"{bin,lib,test}/**/*.js\"",
|
|
151
151
|
"lint:lockfile": "lockfile-lint",
|
|
152
152
|
"lint:engines": "ls-engines",
|
|
153
153
|
"lint:publish": "publint --strict",
|
|
@@ -160,7 +160,12 @@
|
|
|
160
160
|
"renovate": {
|
|
161
161
|
"extends": [
|
|
162
162
|
"github>semantic-release/.github:renovate-config"
|
|
163
|
-
]
|
|
163
|
+
],
|
|
164
|
+
"docker-compose": {
|
|
165
|
+
"managerFilePatterns": [
|
|
166
|
+
"/(^|/)e2e\\.compose\\.ya?ml$/"
|
|
167
|
+
]
|
|
168
|
+
}
|
|
164
169
|
},
|
|
165
|
-
"packageManager": "npm@
|
|
170
|
+
"packageManager": "npm@12.0.0+sha512.ab3bcf41f35263b968ba233aaefedd2f4862e5eb0118b9f594bc316ddc8be57388b2c5b3a183309fcc6abd68587192faa274e47a7612c6bb4ac6c16b15b505cb"
|
|
166
171
|
}
|
package/docs/README.md
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# semantic-release documentation
|
|
2
|
-
|
|
3
|
-
- [Usage](usage/README.md) - **semantic-release** installation and configuration
|
|
4
|
-
- [Extending](extending/README.md) - Extending **semantic-release** with plugins and shareable configurations
|
|
5
|
-
- [Recipes](recipes/release-workflow/README.md) - Community written recipes for common **semantic-release** use-cases
|
|
6
|
-
- [Developer Guide](developer-guide/README.md) - The essentials of writing a **semantic-release** plugin or shareable configurations
|
|
7
|
-
- [Support](support/README.md) - FAQ and troubleshooting
|