Skip to content

Commit ee810cd

Browse files
authored
fix: changesets release preview (#13149)
* fix: changesets release preview * test changeset file * fix * fix * remove test stuff
1 parent 15fab1d commit ee810cd

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

tools/ci/format_changelog

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
#!/usr/bin/env bash
22

3+
# This script will generate the next release using changeset.
4+
# However, since changeset has its own semvar versioning system
5+
# and we have our custom tags, this script rewrites the CHANGELOG.md
6+
# with each tag as its header and group respective changeset that has
7+
# the tag under it.
8+
#
9+
# The workflow is here:
10+
# https://github.com/smartcontractkit/chainlink/actions/workflows/changesets-preview-pr.yml
11+
312
set -euo pipefail
413

514
if [[ -z "${GITHUB_OUTPUT:-}" ]]; then
@@ -35,7 +44,7 @@ append_changelog_content() {
3544
continue
3645
fi
3746
changesets=$(jq -r --arg key "$tag" '.[$key] | join("\n\n")' tags.json)
38-
read -d '' changelog_content <<EOF
47+
read -d '' changelog_content <<EOF || true
3948
${changelog_content}
4049
4150
## ${tag}
@@ -49,17 +58,17 @@ set_pr_body() {
4958
# GitHub Issues/PRs messages have a max size limit on the message body payload.
5059
# This is the error: `body is too long (maximum is 65536 characters)`.
5160
max_pr_desc_char_length=65000
52-
read -d '' pr_header <<EOF
61+
read -d '' pr_header <<EOF || true
5362
This PR is a preview of the changes that will be included in the next release. Please do not merge this PR.
5463
---
5564
EOF
5665
if [[ ${#changelog_content} -gt $max_pr_desc_char_length ]]; then
57-
read -d '' pr_body <<EOF
66+
read -d '' pr_body <<EOF || true
5867
${pr_header}
5968
The changelog content is too long for the PR description. Please view the full changelog in the [CHANGELOG.md](https://github.com/smartcontractkit/chainlink/blob/changesets/release-preview/CHANGELOG.md)
6069
EOF
6170
else
62-
read -d '' pr_body <<EOF
71+
read -d '' pr_body <<EOF || true
6372
${pr_header}
6473
${changelog_content}
6574
EOF
@@ -71,7 +80,7 @@ EOF
7180
}
7281

7382
set_new_changelog_content() {
74-
read -d '' new_changelog <<EOF
83+
read -d '' new_changelog <<EOF || true
7584
${changelog_content}
7685
${current_changelog}
7786
EOF
@@ -118,7 +127,7 @@ pnpm changeset version
118127
version=$(jq -r '.version' package.json)
119128
echo "version=$version" >> $GITHUB_OUTPUT
120129

121-
read -d '' changelog_content <<EOF
130+
read -d '' changelog_content <<EOF || true
122131
# Changelog Chainlink Core
123132
124133
## ${version} - PREVIEW

0 commit comments

Comments
 (0)