Skip to content

Commit 9869760

Browse files
authored
[REL-4161] switch to printf to allow for backticks in CHANGELOG (#523)
😩 please let this be the last one 😩 Using the heredoc was creating toil because the syntax is kinda fiddly and `workflow_dispatch` is only available on main, so I needed to create a PR and get a review for every change. But in the end, using `printf` is better anyway because it allows for backticks, which bash will try to run if they appear inside an unquoted heredoc. We'll see if the CHANGELOG comes out looking okay, but cursor assures me `printf` works well for multiline content. 🤞 <!-- ld-jira-link --> --- Related Jira issue: [REL-4161: Migrate ld-find-code-refs from Releaser to GHA](https://launchdarkly.atlassian.net/browse/REL-4161) <!-- end-ld-jira-link -->
1 parent d45f25b commit 9869760

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

scripts/release/commit-and-tag.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ tag_exists() (
1111

1212
update_changelog() (
1313
local ts=$(date +"%Y-%m-%d")
14-
local changelog_entry=$(cat << EOF
15-
## [$LD_RELEASE_VERSION] - $ts
16-
$CHANGELOG_ENTRY
17-
EOF
14+
local changelog_entry=$(printf "## [%s] - %s\n%s\n" "$LD_RELEASE_VERSION" "$ts" "$CHANGELOG_ENTRY")
1815

1916
# insert the new changelog entry (followed by empty line) after line 4
2017
# of CHANGELOG.md

0 commit comments

Comments
 (0)