230 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 0a60004a6a fix: handle potential null values in commit message and gitTags trimming
Co-authored-by: alanturing881 <alanturing881@users.noreply.github.com>
2026-07-18 00:59:12 +01: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
Olabode Lawal-Shittabey d871161133 Merge pull request #4209 from semantic-release/chore/docs
docs: integrate new doc site
2026-06-17 10:17:02 -07: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
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
MrGadget 2616d93627 fix(get-git-auth-url.js): Added debug for success (#3595)
Provides a timestamped log entry for this process so it's clear how long this took to complete.
2025-02-09 14:12:26 +00:00
Luca Becker 05a2ea9a06 feat: clarify branch existence requirement in error messages (#3462) 2024-10-25 14:08:28 -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 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
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
Markus Felten 4980cba571 fix(deps): rename read-pkg-up -> read-package-up 2024-04-07 19:26:30 +02: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
Pierre Cavin 0d06f62411 fix: support windows absolute extends (#3062) 2023-11-16 20:04:02 -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
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 d3aae0752c Merge branch 'master' of github.com:semantic-release/semantic-release into beta 2023-01-27 16:09:41 -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
Chris. Webster 5df624c6e5 fix(windows): fixed issues preventing execution from windows (#2672) 2023-01-23 20:38:37 -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
Gregor Martynus d13ea9280e style: prettier (#2624) 2022-11-23 16:02:51 -08:00
Matt Travi cf6befa2e8 fix(secrets-masking): used the proper named import from hook-std to enable masking for stderr (#2619) 2022-11-20 21:22:32 -08: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 ab45ab1f8d chore(lint): disabled rules that dont apply to this project (#2408)
the performance and readability of reduce is not a concern in this project since maintainers are
familiar with the idiom and are iterating over small lists. the filter rule is disabled selectively
since the filter being identified is not Array.filter

closes #2403
2022-04-02 15:33:08 -07:00
Axieum 80e1665037 fix: corrected spelling of invalid plugin config error (#1979) 2021-06-15 09:52:19 -05:00
Ashish Santikari 2b6c9ba093 docs: update documentation for addNote function (#1833)
Co-Authored-By: Virgil <virgilwashere@users.noreply.github.com>
2021-03-04 16:19:31 -08:00
Nick 3ecc196d8a feat(config): Use cosmiconfig defaults to support .cjs config files (#1815)
This change adds support for `*.cjs` config files by removing the
explicit use of `searchPlaces` options and relying and the default
search places generated by `cosmicconfig`.  As per the docs for
[`cosmicconfig`][cc], the defaults include all the extensions/formats
previously supported by semantic-release in addition to the new .cjs
variants.

Resolves [#1814][issue].

[issue]: https://github.com/semantic-release/semantic-release/issues/1814
[cc]: https://github.com/davidtheclark/cosmiconfig#searchplaces
2021-02-25 21:04:04 -06:00
Dominykas Blyžė 21c151f167 fix: normalize ci: false into noCi: true after configs get merged (#1732) thanks @dominykas
This makes sure that options.ci is respected even when set inside a shareable config
2021-01-13 07:38:57 -08:00
Dmitriy Dekhanov f8f8fbcac4 fix: escape uri encoded symbols (#1697) 2020-11-19 11:55:09 -08:00
Matt Travi c8d38b6258 style: removed line breaks to align with xo rule (#1689) 2020-11-16 11:32:04 -08:00
Matt Travi ca90b34c4a fix: mask secrets when characters get uri encoded 2020-11-16 10:36:40 -06:00
Arthur Chaloin 2bf377194e fix: use valid git credentials when multiple are provided (#1669) 2020-10-29 11:09:19 -07:00
Arthur Chaloin 77a75f072b fix: don't parse port as part of the path in repository URLs (#1671) 2020-10-28 15:53:03 -07:00
Matt Travi 3abcbaf256 Revert "feat: throw an Error if package.json has duplicate "repository" key (#1656)"
This reverts commit b8fb35c7e1.

fixes #1657
2020-10-12 08:21:24 -05:00
Gregor Martynus b8fb35c7e1 feat: throw an Error if package.json has duplicate "repository" key (#1656) 2020-10-11 14:59:51 -07:00
Tom Williams b4c5d0a436 fix: add logging for when ssh falls back to http (#1639)
Co-authored-by: thomas williams <thomas.williams@thetradedesk.com>
2020-09-17 10:15:04 -07:00
Sven Liebig a4658016d9 feat(bitbucket-basic-auth): support for bitbucket server basic auth (#1578) 2020-06-22 11:26:24 -07:00
Nicholas Shine eed1d3c8cb fix: prevent false positive secret replacement for Golang projects (#1562) 2020-05-24 11:53:00 -07:00
Gregor Martynus 431d571a7b fix: adapt for semver to version 7.3.2 (part II) (#1530) 2020-04-16 14:42:25 -07:00
Gregor Martynus 0363790b8a fix: adapt for semver to version 7.3.2
see https://github.com/npm/node-semver/issues/322
2020-04-16 13:54:47 -07:00
Gregor Martynus caa3526caa style: xo 2020-04-08 15:13:33 -07:00
greenkeeper[bot] f899fa9a7c chore(package): update xo to version 0.28.1
Closes #1488
2020-03-26 23:55:26 -04:00
Pierre Vanduynslager a93c96fec9 revert: fix: allow plugins to set environment variables to be used by other plugins
This reverts commit 68f7e928f9.
2020-02-07 17:50:14 -05:00