Changing comment step.
This commit is contained in:
@@ -105,7 +105,7 @@ jobs:
|
|||||||
chdir: cloudflare
|
chdir: cloudflare
|
||||||
|
|
||||||
- name: Tofu Plan
|
- name: Tofu Plan
|
||||||
id: tofu_plan
|
id: tofu-plan
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: dnogu/tofu-plan@v1
|
uses: dnogu/tofu-plan@v1
|
||||||
with:
|
with:
|
||||||
@@ -113,37 +113,12 @@ jobs:
|
|||||||
chdir: cloudflare
|
chdir: cloudflare
|
||||||
out: cloudflare.tfplan
|
out: cloudflare.tfplan
|
||||||
|
|
||||||
- name: Build Markdown PR comment from plan file
|
- name: Tofu PR Commenter
|
||||||
run: |
|
uses: alexnorell/tofu-pr-commenter@v2.0.0
|
||||||
mkdir -p tmp
|
|
||||||
{
|
|
||||||
echo "## 🧩 OpenTofu Plan — Cloudflare"
|
|
||||||
echo "**Branch:** \`${{ github.ref_name }}\`"
|
|
||||||
echo "**Exit Code:** \`${{ steps.tofu_plan.outputs.exitcode }}\`"
|
|
||||||
echo "**Working Directory:** \`cloudflare\`"
|
|
||||||
echo ""
|
|
||||||
echo "<details><summary>🪶 Click to expand full plan output</summary>"
|
|
||||||
echo ""
|
|
||||||
echo '```hcl'
|
|
||||||
cat ${GITHUB_WORKSPACE}/cloudflare/cloudflare.tfplan # <-- read file directly, ACT-safe
|
|
||||||
echo '```'
|
|
||||||
echo ""
|
|
||||||
echo "</details>"
|
|
||||||
echo ""
|
|
||||||
echo "*(This plan was automatically generated by the workflow.)*"
|
|
||||||
} > tmp/tofu-plan.md
|
|
||||||
echo "Markdown PR comment built: tmp/tofu-plan.md"
|
|
||||||
|
|
||||||
- name: Comment full Tofu Plan on PR (Gitea safe)
|
|
||||||
uses: https://git.trez.wtf/Trez.One/git-auto-comment@main
|
|
||||||
with:
|
with:
|
||||||
platform: gitea
|
commenter_type: plan
|
||||||
api_url: https://git.trez.wtf/api/v1
|
commenter_input: ${{ steps.tofu-plan.outputs.plan-output }}
|
||||||
token: ${{ secrets.BOT_GITEA_TOKEN }}
|
commenter_exitcode: ${{ steps.tofu-plan.outputs.exitcode }}
|
||||||
pr_index: ${{ needs.check-and-create-pr.outputs.pr_number }}
|
|
||||||
repo_owner: ${{ github.repository_owner }}
|
|
||||||
repo_name: ${{ steps.env-vault-vars.outputs.repo_name }}
|
|
||||||
comment_template_path: tmp/tofu-plan.md
|
|
||||||
|
|
||||||
- name: Wait for manual approval
|
- name: Wait for manual approval
|
||||||
uses: trstringer/manual-approval@v1
|
uses: trstringer/manual-approval@v1
|
||||||
|
|||||||
Reference in New Issue
Block a user