Skip to content

Commit

Permalink
🐛 create-release: handle multiline output correctly (#42)
Browse files Browse the repository at this point in the history
Turns out you can't shove multiline strings into GITHUB_OUTPUT without
heredoc syntax. github/docs#21529

Signed-off-by: David Zager <[email protected]>
  • Loading branch information
djzager authored Aug 14, 2023
1 parent 5d4a920 commit 941cb9e
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions create-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ outputs:
bug-fixes:
description: "Bug fixes introduced in this release"
value: ${{ steps.changelog.outputs.bug-fixes }}
new-contributors:
description: "New contributors to this release"
value: ${{ steps.changelog.outputs.new-contributors }}
runs:
using: "composite"
steps:
Expand Down Expand Up @@ -98,23 +101,29 @@ runs:
echo "## :warning: Breaking Changes" >> ${RELEASE_DOC}
echo "${BREAKING_CHANGES}" >> ${RELEASE_DOC}
echo "" >> ${RELEASE_DOC}
echo "breaking-changes=${BREAKING_CHANGES}" >> $GITHUB_OUTPUT
echo "breaking-changes<<nEOFn" >> $GITHUB_OUTPUT
echo "${BREAKING_CHANGES}" >> $GITHUB_OUTPUT
echo "nEOFn" >> $GITHUB_OUTPUT
fi
FEATURE_CHANGES="$(filterfunc sparkles)"
if [ -n "${FEATURE_CHANGES}" ]; then
echo "## :sparkles: Features" >> ${RELEASE_DOC}
echo "${FEATURE_CHANGES}" >> ${RELEASE_DOC}
echo "" >> ${RELEASE_DOC}
echo "features=${FEATURE_CHANGES}" >> $GITHUB_OUTPUT
echo "features<<nEOFn" >> $GITHUB_OUTPUT
echo "${FEATURE_CHANGES}" >> $GITHUB_OUTPUT
echo "nEOFn" >> $GITHUB_OUTPUT
fi
BUG_FIXES="$(filterfunc bug)"
if [ -n "${BUG_FIXES}" ]; then
echo "## :bug: Bug Fixes" >> ${RELEASE_DOC}
echo "${BUG_FIXES}" >> ${RELEASE_DOC}
echo "" >> ${RELEASE_DOC}
echo "bug-fixes=${BUG_FIXES}" >> $GITHUB_OUTPUT
echo "bug-fixes<<nEOFn" >> $GITHUB_OUTPUT
echo "${BUG_FIXES}" >> $GITHUB_OUTPUT
echo "nEOFn" >> $GITHUB_OUTPUT
fi
# TODO(djzager): More? could make this workflow accept as an argument whether or not
Expand All @@ -124,8 +133,9 @@ runs:
NEW_CONTRIB=$(echo "${NOTES}" | sed -n "/Contributors/,\$p")
if [ -n "${NEW_CONTRIB}" ]; then
echo "${NEW_CONTRIB}" >> ${RELEASE_DOC}
# TODO(djzager): Figure out how to make this work
# echo "new-contributors=$(echo "${NEW_CONTRIB}" | head -n -3)" >> $GITHUB_OUTPUT
echo "new-contributors<<nEOFn" << $GITHUB_OUTPUT
echo "${NEW_CONTRIB}" | head -n -3 >> $GITHUB_OUTPUT
echo "nEOFn" >> $GITHUB_OUTPUT
else
echo "${NOTES}" | sed -n "/Changelog/,\$p" >> ${RELEASE_DOC}
fi
Expand Down

0 comments on commit 941cb9e

Please sign in to comment.