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