@@ -98,36 +98,39 @@ jobs:
9898 working-directory : ${{ env.PACKAGE_NAME }}
9999 id : read_additional_notes
100100 run : |
101-
102- # Check if the .changeset directory exists and the file for the current version is present
103- if [ -f ".changeset/${{ env.VERSION }}.md" ]; then
104- # Read the content of the file
105- RELEASE_NOTES=$(cat ".changeset/${{ env.VERSION }}.md")
106-
107- # Format the release notes and breaking changes into FULL_RELEASE_NOTES
108- # shellcheck disable=SC2129
109- echo "FULL_RELEASE_NOTES<<EOF" >> "$GITHUB_ENV"
110- echo "## Release notes:" >> "$GITHUB_ENV"
111- echo "$RELEASE_NOTES" >> "$GITHUB_ENV"
112- echo "" >> "$GITHUB_ENV"
113- echo "## Commits:" >> "$GITHUB_ENV"
114- echo "${{ env.COMMITS }}" >> "$GITHUB_ENV"
115- echo "" >> "$GITHUB_ENV"
116- # shellcheck disable=SC2129
117- echo "## Breaking changes:" >> "$GITHUB_ENV"
118- echo "${{ env.BREAKING_CHANGES }}" >> "$GITHUB_ENV"
119- echo "EOF" >> "$GITHUB_ENV"
120- else
121- # Print error message and fail the pipeline if the file is not found
122- echo "Error: Release notes file '.changeset/${{ env.VERSION }}.md' not found."
101+ NOTES_FILE=".changeset/${VERSION}.md"
102+ if [ ! -f "$NOTES_FILE" ]; then
103+ echo "Error: Release notes file '$NOTES_FILE' not found."
123104 exit 1
124105 fi
106+
107+ RELEASE_NOTES=$(cat "$NOTES_FILE")
108+
109+ # Build FULL_RELEASE_NOTES via bash env vars ($COMMITS, $BREAKING_CHANGES)
110+ # uses $ bash syntax instead of ${{ env.PARAMETER }} to avoid escaping and multi-line issues
111+ {
112+ echo "FULL_RELEASE_NOTES<<CTF_RELEASE_NOTES_EOF"
113+ echo "## Release notes:"
114+ echo "$RELEASE_NOTES"
115+ echo ""
116+ echo "## Commits:"
117+ echo "$COMMITS"
118+ echo ""
119+ echo "## Breaking changes:"
120+ echo "$BREAKING_CHANGES"
121+ echo "CTF_RELEASE_NOTES_EOF"
122+ } >> "$GITHUB_ENV"
125123 - name : Create GitHub Release
126124 env :
127125 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
128126 run : |
129127 sudo apt-get install -y gh
130- gh release create "${{ env.PACKAGE_NAME }}/${{ env.VERSION }}" --title "${{ env.PACKAGE_NAME }}/${{ env.VERSION }}" --notes "${{ env.FULL_RELEASE_NOTES }}" || true
128+ # Pipe notes via stdin (--notes-file -) instead of inlining ${{ env.FULL_RELEASE_NOTES }}
129+ # into the shell arg list, which would re-introduce the same quoting bug.
130+ printf '%s' "$FULL_RELEASE_NOTES" | \
131+ gh release create "${PACKAGE_NAME}/${VERSION}" \
132+ --title "${PACKAGE_NAME}/${VERSION}" \
133+ --notes-file - || true
131134 - name : Check if 'cmd' directory exists and set environment variable
132135 run : |
133136 if [ -f "$GITHUB_WORKSPACE/${{ env.PACKAGE_NAME }}/cmd/main.go" ]; then
0 commit comments