Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: providecontext.history global in release notes templates#1005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Show file tree
Hide file tree
Changes fromall 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: 6 additions & 0 deletionssemantic_release/cli/changelog_writer.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -149,6 +149,7 @@ def generate_release_notes(
hvcs_client: HvcsBase,
release: Release,
template_dir: Path,
history: ReleaseHistory,
) -> str:
release_notes_env = ReleaseNotesContext(
repo_name=hvcs_client.repo_name,
Expand All@@ -163,6 +164,11 @@ def generate_release_notes(
environment(template_dir=template_dir)
)

# TODO: Remove in v10
release_notes_env.globals["context"] = {
"history": history,
}

return render_release_notes(
release_notes_template=get_release_notes_template(template_dir),
template_env=release_notes_env,
Expand Down
7 changes: 5 additions & 2 deletionssemantic_release/cli/commands/changelog.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,7 +34,9 @@ def post_release_notes(
"\n",
[
f"would have posted the following release notes for tag {release_tag}:",
release_notes,
# Escape square brackets to ensure all content is displayed in the console
# (i.e. prevent interpretation of ansi escape sequences that is valid markdown)
release_notes.replace("[", "\\["),
],
)
)
Expand DownExpand Up@@ -112,7 +114,8 @@ def changelog(cli_ctx: CliContextObj, release_tag: str | None) -> None:
release_notes = generate_release_notes(
hvcs_client,
release,
template_dir=runtime.template_dir,
runtime.template_dir,
release_history,
)

try:
Expand Down
3 changes: 2 additions & 1 deletionsemantic_release/cli/commands/version.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -711,7 +711,8 @@ def version( # noqa: C901
release_notes = generate_release_notes(
hvcs_client,
release_history.released[new_version],
template_dir=runtime.template_dir,
runtime.template_dir,
history=release_history,
)

exception: Exception | None = None
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp