Skip to content

Commit 1600a47

Browse files
fix: keep git output out of the changelog increment file
When `changelog_increment_filename` is set, the action redirects the bump command's stdout to that file. Without `--git-output-to-stderr`, the post-bump `git commit` output (e.g. `[main abcdef] bump: version 0.0.0 -> 0.1.0` and the `2 files changed, ...` summary) ends up appended to the changelog file, producing a noisy artifact that has to be hand-cleaned before it can be used as a release body. When `changelog_increment_filename` is supplied, force `--git-output-to-stderr` unless the user already enabled it via `git_redirect_stderr: true`. The changelog file then contains only the actual changelog content. Closes #82 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 338bbd8 commit 1600a47

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ if [[ $INPUT_MANUAL_VERSION ]]; then
9595
CZ_CMD+=("$INPUT_MANUAL_VERSION")
9696
fi
9797
if [[ $INPUT_CHANGELOG_INCREMENT_FILENAME ]]; then
98+
# Avoid polluting the changelog increment file with git's commit output
99+
# (e.g. "[main abcdef] bump: ..." and the file-change summary).
100+
# Force git output to stderr unless the user already enabled it.
101+
if [[ $INPUT_GIT_REDIRECT_STDERR != 'true' ]]; then
102+
CZ_CMD+=('--git-output-to-stderr')
103+
fi
98104
CZ_CMD+=('--changelog-to-stdout')
99105
echo "${CZ_CMD[@]}" ">$INPUT_CHANGELOG_INCREMENT_FILENAME"
100106
"${CZ_CMD[@]}" >"$INPUT_CHANGELOG_INCREMENT_FILENAME"

0 commit comments

Comments
 (0)