Skip to content

Commit

Permalink
Maybe this time
Browse files Browse the repository at this point in the history
  • Loading branch information
janbuchar committed Oct 24, 2024
1 parent 5c6eb2c commit 7d4cd03
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion git-cliff-release/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,16 @@ runs:
dump_context_args=()
enhance_context_args=()
print_changelog_args=()
out_file=$GIT_CLIFF_WORKDIR/new_changelog.md
if [[ -n "${{ inputs.existing_changelog_path }}" ]]; then
out_file=$GIT_CLIFF_WORKDIR/existing_changelog.md
cp "${{ github.workspace }}/${{ inputs.existing_changelog_path }}" $out_file
sed '/<!-- git-cliff-unreleased-start -->/,/<!-- git-cliff-unreleased-end -->/d' -i $out_file
dump_context_args+=(--unreleased)
print_changelog_args+=(--prepend "$out_file" --unreleased)
else
out_file=$GIT_CLIFF_WORKDIR/new_changelog.md
print_changelog_args+=(--output "$out_file")
fi
Expand Down
2 changes: 1 addition & 1 deletion git-cliff-release/cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ body = """
{% else %}\
{{ commit.message | upper_first }}\
{% endif %}\
{{" "}}([{{ commit.id | truncate(length = 7, end = "") }}]({{ commit.extra.commit_link }}))\
{% if commit.extra.commit_link %} ([{{ commit.id | truncate(length = 7, end = "") }}]({{ commit.extra.commit_link }})){% endif %}\
{% if commit.remote.username and extra.is_release_notes %}\
{{" "}}by @{{ commit.remote.username }}\
{% elif commit.remote.username %}\
Expand Down
2 changes: 1 addition & 1 deletion git-cliff-release/enhance_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def enhance_release(


def enhance_commit(commit: dict[str, Any], pr_issues: dict[int, list[int]]) -> None:
pr_number = commit["remote"]["pr_number"]
pr_number = commit.get("remote", {}).get("pr_number")

commit["extra"] = commit["extra"] or {}
commit["extra"]["commit_link"] = f"{repo_url}/commit/{commit['id']}"
Expand Down

0 comments on commit 7d4cd03

Please sign in to comment.