...
This commit is contained in:
@@ -118,9 +118,14 @@ jobs:
|
|||||||
chdir: cloudflare
|
chdir: cloudflare
|
||||||
out: cloudflare.tfplan
|
out: cloudflare.tfplan
|
||||||
|
|
||||||
- name: Save plan output to file (with collapsible Markdown)
|
- name: Save plan output to file (with collapsible Markdown, ACT-safe)
|
||||||
run: |
|
run: |
|
||||||
mkdir -p tmp
|
mkdir -p tmp
|
||||||
|
|
||||||
|
# Save raw plan output first
|
||||||
|
echo "${{ steps.tofu_plan.outputs.plan-output }}" > tmp/tofu-plan-raw.txt
|
||||||
|
|
||||||
|
# Build Markdown file safely
|
||||||
{
|
{
|
||||||
echo "## 🧩 OpenTofu Plan — Cloudflare"
|
echo "## 🧩 OpenTofu Plan — Cloudflare"
|
||||||
echo "**Branch:** \`${{ github.ref_name }}\`"
|
echo "**Branch:** \`${{ github.ref_name }}\`"
|
||||||
@@ -130,15 +135,17 @@ jobs:
|
|||||||
echo "<details><summary>🪶 Click to expand full plan output</summary>"
|
echo "<details><summary>🪶 Click to expand full plan output</summary>"
|
||||||
echo ""
|
echo ""
|
||||||
echo '```hcl'
|
echo '```hcl'
|
||||||
printf "%s\n" "${{ steps.tofu_plan.outputs.plan-output }}" # safer than 'cat <<<'
|
cat tmp/tofu-plan-raw.txt
|
||||||
echo '```'
|
echo '```'
|
||||||
echo ""
|
echo ""
|
||||||
echo "</details>"
|
echo "</details>"
|
||||||
echo ""
|
echo ""
|
||||||
echo "*(This plan was automatically generated by the workflow.)*"
|
echo "*(This plan was automatically generated by the workflow.)*"
|
||||||
} > tmp/tofu-plan.md
|
} > tmp/tofu-plan.md
|
||||||
|
|
||||||
echo "Plan file saved: tmp/tofu-plan.md ($(wc -c < tmp/tofu-plan.md) bytes)"
|
echo "Plan file saved: tmp/tofu-plan.md ($(wc -c < tmp/tofu-plan.md) bytes)"
|
||||||
|
|
||||||
|
|
||||||
- name: Comment full Tofu Plan on PR (safe)
|
- name: Comment full Tofu Plan on PR (safe)
|
||||||
uses: https://git.trez.wtf/Trez.One/git-auto-comment@main
|
uses: https://git.trez.wtf/Trez.One/git-auto-comment@main
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user