Skip to content

Commit 02426c4

Browse files
committed
no message
1 parent b00ff68 commit 02426c4

File tree

1 file changed

+24
-35
lines changed

1 file changed

+24
-35
lines changed

.github/workflows/generate-changeset.yml

Lines changed: 24 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -175,29 +175,22 @@ jobs:
175175
176176
PR_TITLE=$(echo "$PR_DATA" | jq -r '.title')
177177
178-
# Create the PR body using heredoc to preserve special characters
179-
cat > /tmp/pr_body.md << 'EOL'
180-
## Upcoming Changes
181-
182-
$(cat /tmp/release-notes/temp_notes.md)
183-
EOL
184-
185-
# Add @since updates section if there are any, using printf to handle special characters
178+
# Create the PR body with proper formatting
179+
PR_BODY="## Upcoming Changes"
180+
PR_BODY="${PR_BODY}"$'\n\n'
181+
PR_BODY="${PR_BODY}$(cat /tmp/release-notes/temp_notes.md)"
182+
183+
# Add @since updates section if there are any
186184
if [[ "${{ steps.check_since.outputs.has_updates }}" == "true" ]]; then
187-
printf "\n\n%s\n" "${{ steps.check_since.outputs.summary }}" >> /tmp/pr_body.md
185+
PR_BODY="${PR_BODY}"$'\n\n'
186+
PR_BODY="${PR_BODY}${{ steps.check_since.outputs.summary }}"
188187
fi
189188
190-
# Add the footer
191-
echo -e "\nThis PR contains all changes that will be included in the next release. It is automatically updated when new changesets are added to the develop branch." >> /tmp/pr_body.md
189+
PR_BODY="${PR_BODY}"$'\n\n'
190+
PR_BODY="${PR_BODY}This PR contains all changes that will be included in the next release. It is automatically updated when new changesets are added to the develop branch."
192191
193-
# Read the complete PR body and escape it for JSON
194-
PR_BODY=$(cat /tmp/pr_body.md)
195-
196-
# Use jq to properly escape the content for JSON
197-
PAYLOAD=$(jq -n \
198-
--arg body "$PR_BODY" \
199-
--arg title "$PR_TITLE" \
200-
'{body: $arg.body, title: $arg.title}')
192+
# Use jq to properly escape the content
193+
PAYLOAD=$(jq -n --arg body "$PR_BODY" --arg title "$PR_TITLE" '{body: $body, title: $title}')
201194
202195
# For debugging
203196
echo "API Payload:"
@@ -220,31 +213,27 @@ jobs:
220213
- name: Create new release PR
221214
if: steps.check_pr.outputs.exists == 'false'
222215
run: |
223-
# Create the PR body using heredoc to preserve special characters
224-
cat > /tmp/pr_body.md << 'EOL'
225-
## Upcoming Changes
226-
227-
$(cat /tmp/release-notes/temp_notes.md)
228-
EOL
229-
230-
# Add @since updates section if there are any, using printf to handle special characters
216+
# Create the PR body with proper formatting
217+
PR_BODY="## Upcoming Changes"
218+
PR_BODY="${PR_BODY}"$'\n\n'
219+
PR_BODY="${PR_BODY}$(cat /tmp/release-notes/temp_notes.md)"
220+
221+
# Add @since updates section if there are any
231222
if [[ "${{ steps.check_since.outputs.has_updates }}" == "true" ]]; then
232-
printf "\n\n%s\n" "${{ steps.check_since.outputs.summary }}" >> /tmp/pr_body.md
223+
PR_BODY="${PR_BODY}"$'\n\n'
224+
PR_BODY="${PR_BODY}${{ steps.check_since.outputs.summary }}"
233225
fi
234226
235-
# Add the footer
236-
echo -e "\nThis PR contains all changes that will be included in the next release. It is automatically updated when new changesets are added to the develop branch." >> /tmp/pr_body.md
237-
238-
# Read the complete PR body and escape it for JSON
239-
PR_BODY=$(cat /tmp/pr_body.md)
227+
PR_BODY="${PR_BODY}"$'\n\n'
228+
PR_BODY="${PR_BODY}This PR contains all changes that will be included in the next release. It is automatically updated when new changesets are added to the develop branch."
240229
241-
# Use jq to properly escape the content for JSON
230+
# Use jq to properly escape the content
242231
PAYLOAD=$(jq -n \
243232
--arg title "release: next version 📦" \
244233
--arg head "develop" \
245234
--arg base "main" \
246235
--arg body "$PR_BODY" \
247-
'{title: $arg.title, head: $arg.head, base: $arg.base, body: $arg.body}')
236+
'{title: $title, head: $head, base: $base, body: $body}')
248237
249238
# For debugging
250239
echo "API Payload:"

0 commit comments

Comments
 (0)