Plan PR comment and approval steps.

This commit is contained in:
2025-11-02 18:03:19 -05:00
parent 3e42235036
commit 566ed4d160
+33 -31
View File
@@ -121,12 +121,14 @@ jobs:
chdir: cloudflare
out: cloudflare.tfplan
- name: Post PR comment
uses: borchero/terraform-plan-comment@v2.4.1
- name: PR Comment
uses: alexnorell/tofu-pr-commenter@v1
env:
GITHUB_TOKEN: ${{ secrets.BOT_GITEA_TOKEN }}
with:
token: ${{ secrets.BOT_GITEA_TOKEN }}
planfile: cloudflare.tfplan
terraform-cmd: tofu
commenter_type: plan
commenter_input: ${{ steps.tofu_plan.outputs.plan-output }}
commenter_exitcode: ${{ steps.step_id.outputs.exitcode }}
- name: Wait for manual approval
uses: trstringer/manual-approval@v1
@@ -161,32 +163,32 @@ jobs:
# ${{ steps.tofu_plan.outputs.plan-output }}
# Exit Code: ${{ steps.tofu_plan.outputs.exitcode }}
apply:
name: Apply Tofu Plan
needs: approval
runs-on: ubuntu-latest
if: ${{ needs.approval.result == 'success' }}
env:
VAULT_TOKEN: ${{ secrets.VAULT_GITEA_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
# apply:
# name: Apply Tofu Plan
# needs: approval
# runs-on: ubuntu-latest
# if: ${{ needs.approval.result == 'success' }}
# env:
# VAULT_TOKEN: ${{ secrets.VAULT_GITEA_TOKEN }}
# steps:
# - name: Checkout
# uses: actions/checkout@v4
- name: Setup OpenTofu
uses: opentofu/setup-opentofu@v1.0.6
with:
version: ${{ env.OPENTOFU_VERSION }}
tofu_wrapper: true
# - name: Setup OpenTofu
# uses: opentofu/setup-opentofu@v1.0.6
# with:
# version: ${{ env.OPENTOFU_VERSION }}
# tofu_wrapper: true
- name: Export env from Vault
run: |
set -a
source cloudflare/.env
set +a
# - name: Export env from Vault
# run: |
# set -a
# source cloudflare/.env
# set +a
- name: Run Tofu Apply
uses: dnogu/tofu-apply@v1
with:
working-directory: .
chdir: cloudflare
plan: cloudflare.tfplan
# - name: Run Tofu Apply
# uses: dnogu/tofu-apply@v1
# with:
# working-directory: .
# chdir: cloudflare
# plan: cloudflare.tfplan