Skip to content

Commit 421389a

Browse files
committed
refactor: improve PR body generation with conditional attention note handling
1 parent 6cc87a0 commit 421389a

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

.github/workflows/helm-update-chart.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -359,21 +359,23 @@ jobs:
359359
| .[]
360360
')
361361
362-
# Create PR body file to avoid YAML escaping issues
363-
cat > /tmp/pr_body.md << 'PREOF'
364-
## Summary
365-
366-
Automated update of Helm chart components.
367-
368-
## Components Updated
369-
370-
PREOF
371-
echo "${ATTENTION_NOTE}" >> /tmp/pr_body.md
372-
echo "" >> /tmp/pr_body.md
373-
echo "${COMPONENTS_TABLE}" >> /tmp/pr_body.md
374-
echo "" >> /tmp/pr_body.md
375-
echo "---" >> /tmp/pr_body.md
376-
echo "*This PR was automatically generated by the CI/CD pipeline.*" >> /tmp/pr_body.md
362+
# Create PR body file
363+
{
364+
echo "## Summary"
365+
echo ""
366+
echo "Automated update of Helm chart components."
367+
echo ""
368+
if [ -n "${ATTENTION_NOTE}" ]; then
369+
echo "${ATTENTION_NOTE}"
370+
echo ""
371+
fi
372+
echo "## Components Updated"
373+
echo ""
374+
echo "${COMPONENTS_TABLE}"
375+
echo ""
376+
echo "---"
377+
echo "*This PR was automatically generated by the CI/CD pipeline.*"
378+
} > /tmp/pr_body.md
377379
378380
# Create PR
379381
PR_URL=$(gh pr create \

0 commit comments

Comments
 (0)