Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
16 changes: 7 additions & 9 deletions src/semantic_release/cli/commands/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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(
Expand Down
5 changes: 5 additions & 0 deletions tests/fixtures/git_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 8 additions & 0 deletions tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
),
)


Expand Down
Loading