321 Commits

Author SHA1 Message Date
Olabode Lawal-Shittabey 1beed123fa feat: integrate @semantic-release/core engine (#4256)
This pull request refactors the core logic of the package to use the
`@semantic-release/core` engine directly, removes legacy and duplicated
code, and centralizes configuration. The changes simplify the codebase
by delegating most of the release logic to the upstream core package,
making the CLI wrapper thinner and easier to maintain. Several internal
utility files for branch and tag handling are also removed, as their
logic is now handled by `@semantic-release/core`.

### Migration to Core Engine

* The CLI now delegates release logic to `@semantic-release/core`, using
its `resolveConfig`, `getLogger`, and other helpers, instead of
maintaining a custom implementation. This reduces maintenance overhead
and ensures alignment with the core release logic.
* The documentation is updated to explain that `semantic-release` uses
`@semantic-release/core` as its engine, and provides guidance for
advanced use cases.

### Configuration and Defaults

* A new `SEMANTIC_RELEASE_DEFAULT_CONFIG` constant is introduced,
centralizing the default plugin stack for releases.

### Codebase Simplification

* Removes internal implementations for branch expansion, tag retrieval,
and normalization, as well as related validation and error handling
logic. These are now handled by the core engine.
2026-10-06 06:42:49 +01:00
Gregor Martynus 8d905a56e8 fix: do not expose the authenticated repository URL in EGITNOPERMISSION errors (#4283)
## Problem

`EGITNOPERMISSION` interpolates `options.repositoryUrl` into the error
`details`. By the time this error is thrown (`index.js`, after
`verifyAuth` fails), `options.repositoryUrl` has been replaced with the
result of `getGitAuthUrl()`, which can embed CI credentials (`GH_TOKEN`,
`GITHUB_TOKEN`, `GL_TOKEN`, `BB_TOKEN`, …) as basic-auth in the URL.

The existing masking covers most paths — terminal output goes through
the `hookStd(hideSensitive(env))` hook, the CLI masks the inspected
error before printing, and fail-plugin inputs are masked via
`hideSensitiveValues` — but the thrown error object itself is rethrown
**unmasked** to programmatic API consumers after `unhook()`. Any wrapper
that catches the error and reports `error.details` elsewhere (PR
comment, CI annotation, error tracker) would leak the token.

## Fix

Use `options.originalRepositoryURL` — the URL as configured, saved
before `getGitAuthUrl()` rewrites it — in the error details, falling
back to `repositoryUrl` when it isn't set (e.g. when the error factory
is invoked directly with a partial context).

## Testing

- Added `test/definitions/errors.test.js` covering that the details
contain the original URL and not the credential-bearing one, plus the
fallback.
- `npx ava test/definitions/` and `npm run lint:prettier` pass.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-05 04:41:45 +00:00
babblebey f121540e89 fix: prevent template evaluation syntax in branch expansion and tag formatting
Co-authored-by: alanturing881 <alanturing881@users.noreply.github.com>
2026-07-18 00:59:12 +01:00
babblebey 973d763c2e fix(hide-sensitive): mask key/auth/webhook env vars
Co-authored-by: alanturing881 <alanturing881@users.noreply.github.com>
2026-07-18 00:59:12 +01:00
Gregor Martynus c46dbdaeda fix: argument Injection via repositoryUrl in package.json (#4245)
Co-Authored-By: Abhijith S abh78i00@gmail.com
2026-07-12 22:23:08 -07:00
Gregor Martynus f293647392 Merge commit from fork
* fix: ensure percent-encoded secrets get masked

Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>

* fix: mask secrets in the exact form url.format() embeds them in git URLs

The authenticated repository URL is built with the legacy url.format(),
which encodes the auth field like encodeURIComponent() except that ":"
separators are kept as is. A GIT_CREDENTIALS value such as
"user:abc@def-secret" therefore appears as "user:abc%40def-secret" in a
failing git command, a form matched by neither the raw value, encodeURI(),
nor encodeURIComponent() candidates, and leaked unmasked.

Add the colon-preserving encoded form to the redaction candidates, assert
the unit tests against URLs built the same way get-git-auth-url.js builds
them, and add an integration test reproducing the leak end-to-end with a
git remote on a closed loopback port.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Matt Travi <programmer@travi.org>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 15:06:51 -07:00
Matt Travi b19d4c168a test(e2e): move compose file out of the test/ directory
to help make it discoverable to renovate
2026-06-28 22:36:52 -05:00
Matt Travi c2586029d3 test(e2e): migrate from raw use of dockerode to use testcontainers instead (#4221)
which uses dockerode internally. this is a follow up to
https://github.com/semantic-release/semantic-release/pull/4220 to simplify teardown and avoid
managing the complexity as directly
2026-06-28 14:21:27 -07:00
Matt Travi 38abd1e157 test(e2e): drain the container stream for gitbox to resolve hang after completion (#4220) 2026-06-28 11:22:03 -07:00
Matt Travi 8f57c55f71 test(integration): push local git notes to "remote" test repo
to avoid them being pruned by personal config when unshallowing the test repo
2026-03-02 08:13:18 -06:00
Luis Sebastian Urrutia Fuentes f4041244ad fix(deps): remove deprecated semver-diff (#3980)
Co-authored-by: Matt Travi <126441+travi@users.noreply.github.com>
2026-01-30 21:11:47 +00:00
Matt Travi 0c34a932d9 test(verdaccio): update to the current major of verdaccio 2025-10-13 10:09:01 -05:00
Tomáš Vojtášek 85187e2cb6 perf(get-tags.js): bulk get for tags notes (#3732)
Co-authored-by: Matt Travi <126441+travi@users.noreply.github.com>
2025-07-11 14:33:04 -05:00
Andreas Bichinger 07f2672e25 fix(branch-naming): prevent non-range versions from being identified as maintenance branches
This change makes the second segment the optional one rather than the third segment. That ensures that a maintenance branch always needs to end with `.x`

Co-authored-by: Matt Travi <programmer@travi.org>
2024-10-18 23:16:01 +02:00
Olabode Lawal-Shittabey 43df51b79e fix(deps): update @semantic-release/github to v11.0.0 (#3460)
* chore(deps): update @semantic-release/github to v11.0.0

* refactor: Update e2e.test.js to include clone_url in GET request

* refactor: Update e2e.test.js to include clone_url in GET request

* refactor: Include clone_url in GET request in e2e.test.js
2024-09-27 17:51:44 +01:00
Olabode Lawal-Shittabey bcc663ccf0 feat: add warn type to global context.logger (#3423)
* add `warn` type to logger in `getLogger`

* test: update test case `'Expose "error", "success" and "log" functions'`

* type: add `warn` to `logger` type interface

* doc: add available logger function to docs

* type: update type interface doc for `logger`
2024-08-17 13:24:21 +01:00
Matt Travi 9200cd67a2 test(e2e): run individual tests serially 2024-06-21 23:29:08 -05:00
Matt Travi 5dac74eaf7 test(integration): renamed the index test file to integration to better align w/ the new categories 2024-06-21 23:29:08 -05:00
Matt Travi 4875a431a6 test(e2e): renamed the e2e test file to align with new test categories 2024-06-21 23:29:08 -05:00
Dustin Ruetz 2620c1078d docs: update file extensions to include .mjs on configuration docs page (#3322) 2024-05-28 21:45:11 -05:00
Tim Fisher 95d8736011 feat: add main branch to default release branch config (#1737)
Co-authored-by: Andrei Danilov <andreialexandr.danilov@gmail.com>
Co-authored-by: Oriol Torrillas <otorrillas@gmail.com>
Co-authored-by: Matt Travi <126441+travi@users.noreply.github.com>
2024-05-07 22:30:07 -05:00
pengqiseven 1e29d01474 docs: remove repetitive words (#3217)
Signed-off-by: pengqiseven <i@sohu.com>
Co-authored-by: pengqiseven <i@sohu.com>
2024-03-09 19:54:09 +00:00
Killian Hamayada 020ea7d7d5 fix: use one note reference per tag to prevent conflicts (#2085)
Co-authored-by: Matt Travi <126441+travi@users.noreply.github.com>
2024-01-05 14:51:59 -06:00
xiaolou86 b1683a7b4d docs: fix typos (#3052) 2023-11-08 23:56:53 -06:00
Dominykas Blyžė 6900865324 Support extending ESM based configurations (#3037)
Co-authored-by: Matt Travi <programmer@travi.org>
2023-11-03 15:33:43 -05:00
Matt Travi e623cc642a feat(node-versions): raised the minimum node v20 requirement to v20.6
for auto-registered loader support

BREAKING CHANGE: the minimum supported node version in the v20 major range is now v20.6
2023-09-16 11:52:49 -05:00
Matt Travi 272af21052 style(prettier): adjusted to match prettier v3 expectations 2023-07-05 11:07:42 -05:00
Tijmen van de Meent e4229f9c68 fix: get correct version if prerelease branch shares version with ... (#2416) 2023-06-28 14:38:35 -07:00
Matt Travi e39ae90ae2 test(integration): properly waited for the image pulls to complete (#2842) 2023-06-25 17:51:31 -07:00
Matt Travi 4bf763f264 test(semantic-release-error): switched instanceof check to the native version
since the check provided by the ava assertion seems to fail beyond the context of the test
2023-06-09 16:14:46 -05:00
Matt Travi ab4fe4c3d4 refactor: leverage native async setTimeout rather than delay 2023-05-22 22:25:22 -05:00
Matt Travi 050412eab8 Merge branch 'master' of github.com:semantic-release/semantic-release into beta 2023-03-21 21:46:58 -05:00
Chris. Webster c71d5d94ce test: Windows support in integration tests (#2722)
* ci: win32 escape slash as doubleslash for test

Pathing in stderr output has double backslash in the filename.  The test
will now use double backslash in the existence test.

Signed-off-by: Chris. Webster <chris@webstech.net>

* ci: avoid Windows pop-up in credential tests

Windows uses a `credential.helper` that will open a pop-up for
credentials if they are missing.  A git config parameter will now be set
to avoid the pop-up.

Signed-off-by: Chris. Webster <chris@webstech.net>

---------

Signed-off-by: Chris. Webster <chris@webstech.net>
2023-03-04 12:37:05 -06:00
Chris. Webster c04e827757 test: update docker config for windows support (#2721
There is legacy support for PortBindings and Binds at the root level of
the config.  Currently (including Windows) these reside under the
HostConfig.  ExposedPorts is now used to identify the externally
available ports.

Signed-off-by: Chris. Webster <chris@webstech.net>
2023-03-03 17:09:19 -06:00
Chris. Webster 6ead75bf73 test: index test should reset testdouble (#2723) 2023-03-03 15:58:42 -06:00
Chris. Webster f991a599f5 test(integration): fix package name conflict (#2719) 2023-02-27 22:01:57 -06:00
Matt Travi d170f73e0b feat(plugins): add support for loading ESM plugins (#2688)
Co-authored-by: Matt Travi <programmer@travi.org>
Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
2023-01-24 23:24:02 -06:00
Gregor Martynus 6a83cb53e5 fix(deps): bump @semantic-release/npm to ^10.0.0-beta.1 (#2670) 2023-01-14 14:14:04 -08:00
Matt Travi caa8b95f7b test(integration): used token auth for registry interactions rather than legacy auth 2022-12-17 22:53:11 -06:00
Matt Travi 6051fae63f Revert "test(integration): ran tests serially in hope of avoiding conflicts in the ci environment"
This reverts commit 71f45f97b1.
2022-12-02 16:42:21 -06:00
Matt Travi 62846a110b test(integration): omitted the GITHUB_ACTION env var as well 2022-12-02 16:35:57 -06:00
Matt Travi 71f45f97b1 test(integration): ran tests serially in hope of avoiding conflicts in the ci environment 2022-12-02 14:44:29 -06:00
Matt Travi f32fd5889a test(integration): updated the simulated environment to omit the GITHUB_ACTIONS variable from the test env 2022-12-02 14:20:04 -06:00
Gregor Martynus d13ea9280e style: prettier (#2624) 2022-11-23 16:02:51 -08:00
Matt Travi 1b6254880c test: aligned pluginName with naming for functions 2022-11-13 00:43:46 -06:00
Matt Travi f7c85e3fff test(index): forced plugins to use semantic-release beta
which deduped env-ci to the esm-only version, allowing test double to stub properly
2022-11-11 11:01:16 -06:00
Matt Travi 9eab1adb9d feat(esm): convert to esm (#2569)
for #2543

BREAKING CHANGE: semantic-release is now ESM-only. since it is used through its own executable, the impact on consuming projects should be minimal

BREAKING CHANGE: references to plugin files in configs need to include the file extension because of executing in an ESM context
2022-11-11 09:24:06 -06:00
Matt Travi 4cd3641dbf refactor(plugins): switched from require to await import() when loading plugins (#2558) 2022-09-17 14:10:05 -07:00
Matt Travi 9a513a38f7 test: replaced proxyquire with testdouble (#2537)
for #2133

Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
2022-08-26 09:32:52 -07:00
Matt Travi 5eea7c948e test(mockserver): switched to the modern mockserver/mockserver image to get multi-arch support (#2536)
fixes #2478
2022-08-26 09:26:09 -07:00