From e28ffc300ef073e5018e9c09dea501e756c6b923 Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Sun, 30 Aug 2026 14:03:15 -0600 Subject: [PATCH 1/3] refactor(cmd-changelog): harden toml parsing of git extracted DOS/Windows toml contents (#1487) --- src/semantic_release/cli/commands/changelog.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/semantic_release/cli/commands/changelog.py b/src/semantic_release/cli/commands/changelog.py index c895eb8e5..387bcc885 100644 --- a/src/semantic_release/cli/commands/changelog.py +++ b/src/semantic_release/cli/commands/changelog.py @@ -5,8 +5,8 @@ from typing import TYPE_CHECKING import click -import tomlkit from git import GitCommandError, Repo +from tomlkit import parse as toml_parse from semantic_release.changelog.release_history import ReleaseHistory from semantic_release.cli.changelog_writer import ( @@ -33,16 +33,14 @@ def get_license_name_for_release(tag_name: str, project_root: Path) -> str: for allowed_dir in allowed_directories: proj_toml = allowed_dir.joinpath("pyproject.toml") with Repo(project_root) as git_repo, suppress(GitCommandError): + # git.show arbitrarily removes the last linux line ending, leaving a bare carriage + # return at the end of a DOS/Windows file, which causes parsing issues as + # tomlkit >= 0.15 rejects bare carriage returns as invalid characters. toml_contents = git_repo.git.show( f"{tag_name}:{proj_toml.relative_to(project_root)}" - ) - # Normalize line endings: `git show` returns the blob verbatim, which - # may contain CRLF (or bare CR) when committed from Windows. - # tomlkit >= 0.15 rejects bare carriage returns as invalid characters. - config_toml = tomlkit.parse( - toml_contents.replace("\r\n", "\n").replace("\r", "") - ) - project_metadata = config_toml.unwrap().get("project", project_metadata) + ).rstrip() + config_toml = toml_parse(toml_contents).unwrap() + project_metadata = config_toml.get("project", project_metadata) break license_cfg = project_metadata.get( From 086cf14cb0f1aab87b32dcf9700f782152c3ee84 Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Sun, 30 Aug 2026 14:18:53 -0600 Subject: [PATCH 2/3] test(fixtures): adjust git repo creation fixtures to prevent race conditions (#1488) --- tests/fixtures/git_repo.py | 5 +++++ tests/util.py | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/tests/fixtures/git_repo.py b/tests/fixtures/git_repo.py index 5840f7608..6b2746ba7 100644 --- a/tests/fixtures/git_repo.py +++ b/tests/fixtures/git_repo.py @@ -584,6 +584,11 @@ def _build_repo(cached_repo_path: Path) -> Sequence[RepoActions]: config.set_value("commit", "gpgsign", False) config.set_value("tag", "gpgsign", False) + # Disable automatic garbage collection and background maintenance to prevent race conditions + config.set_value("gc", "auto", 0) + config.set_value("gc", "autoDetach", "false") + config.set_value("maintenance", "auto", "false") + # set up a remote tracking branch for the default branch config.set_value(f'branch "{DEFAULT_BRANCH_NAME}"', "remote", "origin") config.set_value( diff --git a/tests/util.py b/tests/util.py index 7d0e16690..4b4c06767 100644 --- a/tests/util.py +++ b/tests/util.py @@ -157,6 +157,14 @@ def copy_dir_tree(src_dir: Path | str, dst_dir: Path | str) -> None: src=str(src_dir), dst=str(dst_dir), dirs_exist_ok=True, + ignore=shutil.ignore_patterns( + # Ignore temporary and lock files from git + "tmp_pack_*", + "tmp_obj_*", + "tmp_idx_*", + "*.lock", + "gc.pid", + ), ) From f77ed516ca8b54cbdcadf2af91e1446056aa1be4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 30 Aug 2026 14:50:44 -0600 Subject: [PATCH 3/3] ci(deps): bump `mikepenz/action-junit-report@v6.4.2` to `v6.5.0` (#1484) --- .github/workflows/validate.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index e1908717f..278c12582 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -195,7 +195,7 @@ jobs: --junit-xml=tests/reports/pytest-results.xml - name: Report | Upload Test Results - uses: mikepenz/action-junit-report@d9f48fc87bc235f7e214acf696ca5abc0a986f16 # v6.4.2 + uses: mikepenz/action-junit-report@a9170d5795813c01ab4901ffb045b52bab4ab09d # v6.5.0 if: ${{ always() && steps.tests.outcome != 'skipped' }} with: report_paths: ./tests/reports/*.xml @@ -285,7 +285,7 @@ jobs: retention-days: 1 - name: Report | Upload Test Results - uses: mikepenz/action-junit-report@d9f48fc87bc235f7e214acf696ca5abc0a986f16 # v6.4.2 + uses: mikepenz/action-junit-report@a9170d5795813c01ab4901ffb045b52bab4ab09d # v6.5.0 if: ${{ always() && steps.tests.outcome != 'skipped' }} with: report_paths: ./tests/reports/*.xml @@ -405,7 +405,7 @@ jobs: retention-days: 1 - name: Report | Upload Test Results - uses: mikepenz/action-junit-report@d9f48fc87bc235f7e214acf696ca5abc0a986f16 # v6.4.2 + uses: mikepenz/action-junit-report@a9170d5795813c01ab4901ffb045b52bab4ab09d # v6.5.0 if: ${{ always() && steps.tests.outcome != 'skipped' }} with: report_paths: ./tests/reports/*.xml