Skip to content

Commit 91f53ca

Browse files
committed
fix(ci): preserve backticks in release body via --notes-file
The previous workflow captured the awk output into a shell variable, then echoed it into GITHUB_OUTPUT. Bash treats backticks as command substitution, so every inline `code` span in the changelog body was silently stripped — every release shipped with mangled notes (missing identifiers + literals). Switched to writing awk output directly to /tmp/release_notes.md and passing it to gh via --notes-file, which is byte-preserving. Same fix that landed in polymarket-cpp 7eacef1.
1 parent aad8888 commit 91f53ca

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

.github/workflows/release.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@ jobs:
2323
fetch-depth: 0
2424

2525
- name: Extract release notes from CHANGELOG.md
26-
id: extract
2726
run: |
2827
tag="${GITHUB_REF#refs/tags/}"
2928
version="${tag#v}"
30-
notes=$(awk -v v="$version" '
29+
# Pipe directly to a file. DO NOT capture into a shell var
30+
# and echo it back — bash treats backticks as command
31+
# substitution, which silently strips every inline `code`
32+
# span from the release body. Reading via `gh release create
33+
# --notes-file` preserves the bytes verbatim.
34+
awk -v v="$version" '
3135
$0 ~ "^## \\["v"\\]" { capture=1; next }
3236
capture && /^## / { exit }
3337
capture { print }
34-
' CHANGELOG.md)
35-
if [ -z "$notes" ]; then
36-
notes="Release $tag. See CHANGELOG.md for details."
38+
' CHANGELOG.md > /tmp/release_notes.md
39+
if [ ! -s /tmp/release_notes.md ]; then
40+
printf 'Release %s. See CHANGELOG.md for details.\n' "$tag" \
41+
> /tmp/release_notes.md
3742
fi
38-
{
39-
echo "notes<<EOF_NOTES"
40-
echo "$notes"
41-
echo "EOF_NOTES"
42-
} >> "$GITHUB_OUTPUT"
4343
4444
- name: Create GitHub Release
4545
env:
@@ -48,5 +48,5 @@ jobs:
4848
tag="${GITHUB_REF#refs/tags/}"
4949
gh release create "$tag" \
5050
--title "$tag" \
51-
--notes "${{ steps.extract.outputs.notes }}" \
51+
--notes-file /tmp/release_notes.md \
5252
--verify-tag

0 commit comments

Comments
 (0)