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
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:
@@ -16,6 +16,8 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
check-and-create-pr:
|
check-and-create-pr:
|
||||||
name: Check and Create PR
|
name: Check and Create PR
|
||||||
|
outputs:
|
||||||
|
pr_number: ${{ steps.pr-check-create.outputs.pr_number }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
@@ -36,6 +38,7 @@ jobs:
|
|||||||
notification_message: "Checking for existing PR... 🔍"
|
notification_message: "Checking for existing PR... 🔍"
|
||||||
|
|
||||||
- name: PR Check/Creation
|
- name: PR Check/Creation
|
||||||
|
id: pr-check-create
|
||||||
uses: https://git.trez.wtf/Trez/gitea-auto-pr@main
|
uses: https://git.trez.wtf/Trez/gitea-auto-pr@main
|
||||||
with:
|
with:
|
||||||
url: ${{ secrets.TREZ_GITEA_URL }}
|
url: ${{ secrets.TREZ_GITEA_URL }}
|
||||||
@@ -67,34 +70,6 @@ jobs:
|
|||||||
version: ${{ env.OPENTOFU_VERSION }}
|
version: ${{ env.OPENTOFU_VERSION }}
|
||||||
tofu_wrapper: true
|
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
|
- name: Generate .env from Hashicorp Vault
|
||||||
uses: https://git.trez.wtf/Trez/hc-vault-env@main
|
uses: https://git.trez.wtf/Trez/hc-vault-env@main
|
||||||
with:
|
with:
|
||||||
@@ -176,7 +151,7 @@ jobs:
|
|||||||
platform: gitea
|
platform: gitea
|
||||||
api_url: https://git.trez.wtf/api/v1
|
api_url: https://git.trez.wtf/api/v1
|
||||||
token: ${{ secrets.BOT_GITEA_TOKEN }}
|
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_owner: ${{ github.repository_owner }}
|
||||||
repo_name: ${{ steps.env-vault-vars.outputs.repo_name }}
|
repo_name: ${{ steps.env-vault-vars.outputs.repo_name }}
|
||||||
plan_file: cloudflare/cloudflare.tfplan
|
plan_file: cloudflare/cloudflare.tfplan
|
||||||
@@ -193,15 +168,17 @@ jobs:
|
|||||||
# commenter_type: plan
|
# commenter_type: plan
|
||||||
# commenter_input: ${{ steps.tofu_plan.outputs.plan-output }}
|
# commenter_input: ${{ steps.tofu_plan.outputs.plan-output }}
|
||||||
# commenter_exitcode: ${{ steps.tofu_plan.outputs.exitcode }}
|
# commenter_exitcode: ${{ steps.tofu_plan.outputs.exitcode }}
|
||||||
|
|
||||||
approval:
|
approval:
|
||||||
name: Manual Approval
|
name: Manual Approval
|
||||||
needs: plan
|
needs: [check-and-create-pr, plan]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Wait for manual approval
|
- name: Wait for manual approval
|
||||||
uses: hmarr/auto-approve-action@v2
|
uses: hmarr/auto-approve-action@v2
|
||||||
with:
|
with:
|
||||||
message: "Awaiting manual approval to apply Tofu plan"
|
message: "Awaiting manual approval to apply Tofu plan"
|
||||||
|
pull-request-number: ${{ needs.check-and-create-pr.outputs.pr_number }}
|
||||||
|
|
||||||
apply:
|
apply:
|
||||||
name: Apply Tofu Plan
|
name: Apply Tofu Plan
|
||||||
|
|||||||
Reference in New Issue
Block a user