Skip to content

Instantly share code, notes, and snippets.

@grampelberg
Created January 27, 2020 23:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grampelberg/651a4746df8001b45008b5ded1c35592 to your computer and use it in GitHub Desktop.
Save grampelberg/651a4746df8001b45008b5ded1c35592 to your computer and use it in GitHub Desktop.
#!/bin/ash
github_changelog_generator $@
# If CHANGELOG.md exits, copy it to an env var
if [[ -e 'CHANGELOG.md' ]]; then
export CHANGELOG="$(cat CHANGELOG.md | sed ':a;N;$!ba;s/%/%25/g' | sed ':a;N;$!ba;s/\n/%0A/g' | sed ':a;N;$!ba;s/\r/%0D/g)"
fi
echo "$CHANGELOG"
echo ::set-output name=changelog::"${CHANGELOG}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment