Stripping ANSI codes from TF output.

This commit is contained in:
2025-11-22 10:39:41 -05:00
parent a90d076042
commit fad6dd57c1
@@ -114,17 +114,11 @@ jobs:
working-directory: .
chdir: cloudflare
- run: echo "${{ steps.tofu-init.outputs.init-output }}"
- name: ANSI to HTML
id: ansi-to-html-init
uses: https://git.trez.wtf/Trez/actions-ansi-to-html@v1.0.3
env:
ACTIONS_STEP_DEBUG: true
- name: Strip ANSI codes
id: plain-tofu-init
uses: marcransome/remove-ansi-colors@v1.7.56
with:
input: ${{ steps.tofu-init.outputs.init-output }}
- run: echo "${{ steps.ansi-to-html-init.outputs.contents }}"
colored: ${{ steps.tofu-init.outputs.init-output }}
- name: Tofu PR Commenter
uses: https://git.trez.wtf/Trez/tf-pr-commenter@main
@@ -135,7 +129,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.BOT_GITEA_TOKEN }}
with:
commenter_type: init
commenter_input: ${{ steps.tofu-init.outputs.init-output }}
commenter_input: ${{ steps.plain-tofu-init.outputs.init-uncolored }}
commenter_exitcode: ${{ steps.tofu-init.outputs.exitcode }}
git_token: ${{ secrets.BOT_GITEA_TOKEN }}
pr_comments_url: ${{ env.PR_COMMENTS_URL }}
@@ -150,35 +144,31 @@ jobs:
chdir: cloudflare
out: cloudflare.tfplan
- run: pwd
- name: ANSI to HTML
id: ansi-to-html-plan
uses: https://git.trez.wtf/Trez/actions-ansi-to-html@v1.0.3
env:
ACTIONS_STEP_DEBUG: true
- name: Strip ANSI codes
id: plain-tofu-plan
uses: marcransome/remove-ansi-colors@v1.7.56
with:
path: cloudflare/cloudflare.tfplan
colored: ${{ steps.tofu-plan.outputs.plan-output }}
- name: Comment PR with execution number
uses: thollander/actions-comment-pull-request@v3
with:
file-path: cloudflare/cloudflare.tfplan
# - name: Tofu PR Commenter
# uses: https://git.trez.wtf/Trez/tf-pr-commenter@main
# env:
# GITEA_API_URL: ${{ gitea.api_url }}
# GITEA_REPOSITORY: ${{ github.repository }}
# GITEA_PULL_REQUEST_ID: ${{ github.event.pull_request.number }}
# GITHUB_TOKEN: ${{ secrets.BOT_GITEA_TOKEN }}
# - name: Comment PR with execution number
# uses: thollander/actions-comment-pull-request@v3
# with:
# commenter_type: plan
# commenter_input: ${{ steps.tofu-plan.outputs.plan-output }}
# commenter_exitcode: ${{ steps.tofu-plan.outputs.exitcode }}
# git_token: ${{ secrets.BOT_GITEA_TOKEN }}
# pr_comments_url: ${{ env.PR_COMMENTS_URL }}
# working_directory: cloudflare
# file-path: cloudflare/cloudflare.tfplan
- name: Tofu PR Commenter
uses: https://git.trez.wtf/Trez/tf-pr-commenter@main
env:
GITEA_API_URL: ${{ gitea.api_url }}
GITEA_REPOSITORY: ${{ github.repository }}
GITEA_PULL_REQUEST_ID: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.BOT_GITEA_TOKEN }}
with:
commenter_type: plan
commenter_input: ${{ steps.plain-tofu-plan.outputs.uncolored }}
commenter_exitcode: ${{ steps.tofu-plan.outputs.exitcode }}
git_token: ${{ secrets.BOT_GITEA_TOKEN }}
pr_comments_url: ${{ env.PR_COMMENTS_URL }}
working_directory: cloudflare
# - name: Wait for manual approval
# uses: trstringer/manual-approval@v1