requarks / changelog-action

GitHub Action to generate changelog from conventional commits
MIT License
128 stars 41 forks source link

Also allow the file to be written without version / date header #33

Closed sschuberth closed 1 year ago

sschuberth commented 1 year ago

For some scenarios it might be more convenient to have the action's output available in a file for further processing / upload. As such it would be nice if the version / date header could also be omitted when writing the CHANGELOG.md file.

NGPixel commented 1 year ago

Use the steps.changelog.outputs.changes output variable in a subsequent step if you need further processing.

sschuberth commented 1 year ago

I probably should have explained the use-case better for more background information: I'm trying to minimize the use of third-party actions for security (and maintenance) reasons. That's why I prefer to use the runner-provided gh CLI tool to create GitHub releases over using an action like ncipollo/release-action. Now, gh release create --notes '${{ steps.changelog.outputs.changes }}' does not work if there are characters in changes that have a special meaning for the shell. And gh release create --notes-file CHANGELOG.md does basically work, but contains the header. Hence the idea to also be able to omit the header from the file.

NGPixel commented 1 year ago

Then add a shell step to write it to a file?

echo "${{ steps.changelog.outputs.changes }}" > CHANGELOG.md

The goal of CHANGELOG.md is to append to an existing file over time. You're using this file as a temporary step to create a release, which is really not the purpose of CHANGELOG.md.

sschuberth commented 1 year ago

Then add a shell step to write it to a file?

That has the same escaping-of-special-chars issue as gh release create --notes '${{ steps.changelog.outputs.changes }}'.

You're using this file as a temporary step to create a release, which is really not the purpose of CHANGELOG.md.

Ok, understood.