Adjustments for passing PR index in workflow.
Auto-PR Check/Creation and TF/OpenTofu Plan / Check and Create PR (push) Failing after 24s
Auto-PR Check/Creation and TF/OpenTofu Plan / OpenTofu Plan (push) Has been skipped
Auto-PR Check/Creation and TF/OpenTofu Plan / Manual Approval (push) Has been skipped
Auto-PR Check/Creation and TF/OpenTofu Plan / Apply Tofu Plan (push) Has been skipped

This commit is contained in:
2025-11-02 10:11:11 -05:00
parent 7c278fbb35
commit 4e65c97c5b
+7 -30
View File
@@ -16,6 +16,8 @@ env:
jobs:
check-and-create-pr:
name: Check and Create PR
outputs:
pr_number: ${{ steps.pr-check-create.outputs.pr_number }}
runs-on: ubuntu-latest
steps:
- name: Checkout Code
@@ -36,6 +38,7 @@ jobs:
notification_message: "Checking for existing PR... 🔍"
- name: PR Check/Creation
id: pr-check-create
uses: https://git.trez.wtf/Trez/gitea-auto-pr@main
with:
url: ${{ secrets.TREZ_GITEA_URL }}
@@ -67,34 +70,6 @@ jobs:
version: ${{ env.OPENTOFU_VERSION }}
tofu_wrapper: true
- name: Install tea
uses: supplypike/setup-bin@8e3f88b4f143d9b5c3497f0fc12d45c83c123787 # v4.0.1
with:
uri: https://gitea.com/gitea/tea/releases/download/v${{ env.TEA_VERSION }}/tea-${{ env.TEA_VERSION }}-linux-amd64
name: tea
version: ${{ env.TEA_VERSION }}
- name: Extract PR Index
id: tea-pr-index
run: |
tea login add \
--name gitea-rinoa \
--url "${{ secrets.TREZ_GITEA_URL }}" \
--user gitea-sonarqube-bot \
--password "${{ secrets.BOT_GITEA_PASSWORD }}" \
--token ${{ secrets.BOT_GITEA_TOKEN }}
tea login default gitea-rinoa
pr_number=$(tea pr list \
--repo ${{ github.repository }} \
--state open \
--fields index,head \
--output simple \
| awk '{print $1}')
echo "pr_number=$pr_number" >> "$GITHUB_OUTPUT"
- name: Generate .env from Hashicorp Vault
uses: https://git.trez.wtf/Trez/hc-vault-env@main
with:
@@ -176,7 +151,7 @@ jobs:
platform: gitea
api_url: https://git.trez.wtf/api/v1
token: ${{ secrets.BOT_GITEA_TOKEN }}
pr_index: ${{ steps.tea-pr-index.outputs.pr_number }}
pr_index: ${{ needs.check-and-create-pr.outputs.pr_number }}
repo_owner: ${{ github.repository_owner }}
repo_name: ${{ steps.env-vault-vars.outputs.repo_name }}
plan_file: cloudflare/cloudflare.tfplan
@@ -193,15 +168,17 @@ jobs:
# commenter_type: plan
# commenter_input: ${{ steps.tofu_plan.outputs.plan-output }}
# commenter_exitcode: ${{ steps.tofu_plan.outputs.exitcode }}
approval:
name: Manual Approval
needs: plan
needs: [check-and-create-pr, plan]
runs-on: ubuntu-latest
steps:
- name: Wait for manual approval
uses: hmarr/auto-approve-action@v2
with:
message: "Awaiting manual approval to apply Tofu plan"
pull-request-number: ${{ needs.check-and-create-pr.outputs.pr_number }}
apply:
name: Apply Tofu Plan