150 Commits

Author SHA1 Message Date
renovate-bot 8e3b1db82f Merge pull request '🔧 Renovate: Update (patch) Terraform signoz to v0.0.12' (#38) from renovate/terraform-signoz-0-0-12 into main 2026-06-15 18:49:05 -04:00
renovate-bot f51a8aae53 🔧 Renovate: Update (patch) Terraform signoz to v0.0.12 2026-06-15 22:48:58 +00:00
gitea-sonarqube-bot 2a2599e73f Auto Merge of PR 33 - cloudflare-cname-cleanup_2025-11-03T17-03-21
Renovate / renovate (push) Successful in 5m49s
Merged by Trez.One
2025-11-25 14:03:55 -05:00
Trez.One 3b9d2cb7fc Fixing Tofu init step in apply job. 2025-11-25 13:40:28 -05:00
gitea-sonarqube-bot 559edeae9e Auto Merge of PR 31 - cloudflare-cname-cleanup_2025-11-03T17-03-21
Renovate / renovate (push) Successful in 6m18s
Merged by Trez.One
2025-11-25 13:37:49 -05:00
Trez.One 67374b1d3e Forgot to add init step in apply job... 2025-11-25 13:27:25 -05:00
gitea-sonarqube-bot 23b4aea440 Auto Merge of PR 29 - cloudflare-cname-cleanup_2025-11-03T17-03-21
Renovate / renovate (push) Successful in 6m7s
Merged by Trez.One
2025-11-25 13:23:40 -05:00
Trez.One d948b7e729 Switching artifact actions... 2025-11-25 13:16:00 -05:00
Trez.One eeb8905a61 Gotify notifications, no comments, full run. 2025-11-25 12:55:38 -05:00
Trez.One 646c1b4e4d Gotify notifications, no comments, full run. 2025-11-25 12:52:20 -05:00
gitea-sonarqube-bot 420277fb77 Auto Merge of PR 8 - cloudflare-cname-cleanup_2025-11-03T17-03-21
Renovate / renovate (push) Successful in 6m25s
Merged by Trez.One
2025-11-25 12:43:10 -05:00
Trez.One 01fde1f436 Adding PR Merge and Apply jobs, artifact handling. 2025-11-25 12:36:08 -05:00
Trez.One 64f8aab93b Reminder interval. 2025-11-25 10:53:33 -05:00
Trez.One 821bdf56b5 Details and summary tags for issue and PR comments. 2025-11-25 10:32:59 -05:00
Trez.One 65e9063e41 Attempting manual approval with raw plan... 2025-11-25 09:55:09 -05:00
Trez.One 7400108cdd Formatting... 2025-11-25 09:48:36 -05:00
Trez.One a3ab2a8a6d Formatting plan comment. 2025-11-25 06:33:02 -05:00
Trez.One a92c3fc76d Debugging approval status output. 2025-11-25 05:58:36 -05:00
Trez.One 65f24e4bec Debugging approval status output. 2025-11-25 05:51:00 -05:00
Trez.One 755af20097 Testing approval status. 2025-11-25 05:47:12 -05:00
Trez.One a4991fe3d8 Formatting plan comment. 2025-11-24 19:55:38 -05:00
Trez.One f066886a93 Formatting plan comment. 2025-11-24 19:52:25 -05:00
Trez.One 12d8f8c68f Testing approval status. 2025-11-24 19:45:39 -05:00
Trez.One 94f040c7b2 Adding initial comment for approval step. 2025-11-24 19:35:53 -05:00
Trez.One b81afb77fb Updating approvers list. 2025-11-24 19:21:47 -05:00
Trez.One 8a184aa3cc Redoing manual approval step. 2025-11-24 19:18:45 -05:00
Trez.One 0e5093f15f ... 2025-11-24 10:33:05 -05:00
Trez.One cf0d77dc45 Changing manual approval action... 2025-11-24 10:00:56 -05:00
Trez.One 9199c2857b Re-adding manual approval step... fingers crossed. 2025-11-22 10:59:45 -05:00
Trez.One 53e21d2856 Correcting typo. 2025-11-22 10:48:40 -05:00
Trez.One fad6dd57c1 Stripping ANSI codes from TF output. 2025-11-22 10:39:41 -05:00
Trez.One a90d076042 ... 2025-11-22 08:01:44 -05:00
Trez.One e75e35ffd1 ... 2025-11-21 09:29:17 -05:00
Trez.One aa5b32ec69 ... 2025-11-21 07:47:15 -05:00
Trez.One ad5d92b7a9 Reverting to custom ANSI-to-HTML action... 2025-11-21 07:41:35 -05:00
Trez.One 4770696d3e Version fix... 2025-11-21 07:35:08 -05:00
Trez.One c6494d875e Testing other actions... 2025-11-21 07:31:58 -05:00
Trez.One 7fe79dc7e1 Debugging still... 2025-11-19 13:55:19 -05:00
Trez.One 5f5936291c Debugging still... 2025-11-19 13:32:53 -05:00
Trez.One 582b25a525 Debugging at this point... 2025-11-19 13:29:32 -05:00
Trez.One f985a61505 Debugging at this point... 2025-11-19 13:22:49 -05:00
Trez.One 1cb85a66f9 Debugging at this point... 2025-11-19 12:39:57 -05:00
Trez.One cc7f950d06 Still tweaking... 2025-11-19 12:15:36 -05:00
Trez.One c0cf18032e Changing inputs for Tofu PR comments. 2025-11-19 12:06:32 -05:00
Trez.One ab6488c899 Updating ansi-to-html version. 2025-11-19 11:58:07 -05:00
Trez.One ef852ab54d After some long-ass testing, updating ansi-to-html step. 2025-11-19 11:41:07 -05:00
Trez.One bca337b157 Testing custom ANSI to HTML action. 2025-11-19 06:57:37 -05:00
Trez.One f111c76bd0 Re-testing ANSI-to-HTML action... 2025-11-19 06:52:22 -05:00
Trez.One bcb0482b8a PR_COMMENTS_URL for the plan comment step. 2025-11-19 06:29:47 -05:00
Trez.One e3cb806e4b PR_COMMENTS_URL (testing on init step first). 2025-11-19 06:27:23 -05:00
Trez.One aaa7490b33 Updating Gotify action and adding inputs for comment steps. 2025-11-19 06:20:45 -05:00
renovate-bot 6f7a3062d2 Merge pull request '🔧 Renovate: Update (patch) Terraform signoz to v0.0.11' (#13) from renovate/terraform-signoz-0-0-11 into main
Renovate / renovate (push) Successful in 6m30s
2025-11-14 17:07:21 -05:00
renovate-bot b937841d52 🔧 Renovate: Update (patch) Terraform signoz to v0.0.11 2025-11-14 22:07:08 +00:00
renovate-bot aa2d9f817b Merge pull request '🔧 Renovate: Update (patch) Terraform signoz to v0.0.10' (#11) from renovate/terraform-signoz-0-0-10 into main
Renovate / renovate (push) Failing after 3m49s
2025-11-13 17:08:59 -05:00
renovate-bot 7a8fbac96c 🔧 Renovate: Update (patch) Terraform signoz to v0.0.10 2025-11-13 22:08:44 +00:00
Trez.One ad5da8489d ... 2025-11-09 06:35:09 -05:00
Trez.One 04cc5a9f7f Correcting plan step. 2025-11-09 06:20:15 -05:00
Trez.One 013e07f32a Adding Git token auth for comment steps. 2025-11-09 06:04:46 -05:00
Trez.One 96e830c385 Comment steps. 2025-11-08 08:36:12 -05:00
Trez.One 454985fcd6 Removing extra inputs from tofu init step. 2025-11-08 08:16:24 -05:00
Trez.One 4a4ae2fb8c ... 2025-11-07 12:59:36 -05:00
Trez.One e5cccf7d93 Working directory. 2025-11-07 12:55:51 -05:00
Trez.One c9ab9f24b4 ... 2025-11-07 12:40:49 -05:00
Trez.One f46a2f1b89 Adding env PATH for composite steps. 2025-11-07 12:31:13 -05:00
Trez.One c52438e32f ... 2025-11-07 12:12:15 -05:00
Trez.One ce1fd20de0 Removing Tofu cache clear step. 2025-11-07 12:08:29 -05:00
Trez.One 3f6b155c9e Replacing TF PR commenter steps. 2025-11-07 12:01:42 -05:00
Trez.One 58f2c2609d Plan comment step env fix. 2025-11-07 09:56:50 -05:00
Trez.One 139400104d Moving around vars. 2025-11-07 05:15:04 -05:00
Trez.One 7fa19c65f5 Removing commented steps. 2025-11-07 04:54:32 -05:00
Trez.One 4032be67bc Env var configuration. 2025-11-06 09:51:10 -05:00
Trez.One e2787a1640 Env rename for Tofu comment steps. 2025-11-06 08:31:11 -05:00
Trez.One ef53bc66b3 Commenter exitcode Tofu init. 2025-11-06 07:46:36 -05:00
Trez.One cdd81b4dc4 Merge. 2025-11-06 07:37:21 -05:00
Trez.One b58e4a6915 Tofu PR comment testing. 2025-11-06 07:35:58 -05:00
Trez.One 27f3ec14e9 Correction on job output. 2025-11-06 07:35:58 -05:00
Trez.One d808f1e3eb Testing out PR URL... 2025-11-06 07:35:58 -05:00
Trez.One f378d0525e Typo fix, L135. 2025-11-06 07:35:58 -05:00
Trez.One efabc41042 Experimenting... 2025-11-06 07:35:58 -05:00
Trez.One 43f00abe3c Testing still... 2025-11-06 07:35:58 -05:00
Trez.One f2a23e1fb6 Testing still... 2025-11-06 07:35:58 -05:00
Trez.One 71affe3b63 Testing PR comment action. 2025-11-06 07:35:58 -05:00
Trez.One a53f939586 Testing PR comment action. 2025-11-06 07:35:58 -05:00
Trez.One 9768b8e8e0 Testing PR comment action. 2025-11-06 07:35:58 -05:00
Trez.One 51364a0a53 Testing PR comment action. 2025-11-06 07:35:58 -05:00
Trez.One e09c40eab1 Re-enabling tofu_wrapper. 2025-11-06 07:35:58 -05:00
Trez.One d31f51ebf4 Testing out event path contexts... 2025-11-06 07:35:58 -05:00
Trez.One 2cc9d449b5 Testing out event path contexts... 2025-11-06 07:35:58 -05:00
Trez.One d963274f50 Testing out event path contexts... 2025-11-06 07:35:58 -05:00
Trez.One ace89a01b6 ... 2025-11-06 07:35:58 -05:00
Trez.One 6ae4ec41b7 ... 2025-11-06 07:35:58 -05:00
Trez.One db634404a6 ... 2025-11-06 07:35:58 -05:00
Trez.One bc4bd06ac8 ... 2025-11-06 07:35:58 -05:00
Trez.One c1a390d524 Extending step for .tofurc creation. 2025-11-06 07:35:58 -05:00
Trez.One b2b137d75d ... 2025-11-06 07:35:58 -05:00
Trez.One d243237cbf ... 2025-11-06 07:35:58 -05:00
Trez.One 361c38b800 Init output. 2025-11-06 07:35:58 -05:00
Trez.One 59caf6ba4b Clearing Tofu cache for provider refresh. 2025-11-06 07:35:58 -05:00
Trez.One ae133bd331 Expanding Tofu init step. 2025-11-06 07:35:58 -05:00
Trez.One 7348d7e232 Dir tshooting. 2025-11-06 07:35:58 -05:00
Trez.One 096126dacb Dir tshooting. 2025-11-06 07:35:58 -05:00
Trez.One 3a0914859a tfplan location. 2025-11-06 07:35:58 -05:00
Trez.One abdb2cc2de Still tweaking the PR comment step... 2025-11-06 07:35:58 -05:00
Trez.One d8adfc4f55 Still tweaking the PR comment step... 2025-11-06 07:35:58 -05:00
Trez.One 9c632ef06f Switching comment action to custom one. 2025-11-06 07:35:58 -05:00
Trez.One 5be448e8d5 Changing comment step. 2025-11-06 07:35:58 -05:00
Trez.One 6a239276f8 Removing some unused CNAMEs. 2025-11-06 07:35:58 -05:00
Trez.One 106ea0f791 Correction on job output. 2025-11-05 20:39:58 -05:00
Trez.One 81985551c3 Testing out PR URL... 2025-11-05 20:39:58 -05:00
Trez.One a0b5c86c9f Typo fix, L135. 2025-11-05 20:39:58 -05:00
Trez.One 87e4b71e54 Experimenting... 2025-11-05 20:39:58 -05:00
Trez.One a2d5cc2192 Testing still... 2025-11-05 20:39:58 -05:00
Trez.One 8bf9040b5a Testing still... 2025-11-05 20:39:58 -05:00
Trez.One a98c0c1778 Testing PR comment action. 2025-11-05 20:39:58 -05:00
Trez.One 0bc1c823c1 Testing PR comment action. 2025-11-05 20:39:58 -05:00
Trez.One 9f6d9596d4 Testing PR comment action. 2025-11-05 20:39:58 -05:00
Trez.One c4dd4c580a Testing PR comment action. 2025-11-05 20:39:58 -05:00
Trez.One 5815302040 Re-enabling tofu_wrapper. 2025-11-05 20:39:58 -05:00
Trez.One 4968329d5c Testing out event path contexts... 2025-11-05 20:39:58 -05:00
Trez.One 9c1e744bcd Testing out event path contexts... 2025-11-05 20:39:58 -05:00
Trez.One 29536213ca Testing out event path contexts... 2025-11-05 20:39:58 -05:00
Trez.One 5f8f508d27 ... 2025-11-05 20:39:58 -05:00
Trez.One 27512702d8 ... 2025-11-05 20:39:58 -05:00
Trez.One f8c1099a21 ... 2025-11-05 20:39:58 -05:00
Trez.One dcb95351a9 ... 2025-11-05 20:39:58 -05:00
Trez.One b5b9d8138c Extending step for .tofurc creation. 2025-11-05 20:39:58 -05:00
Trez.One c97fd38348 ... 2025-11-05 20:39:58 -05:00
Trez.One b926eb571b ... 2025-11-05 20:39:58 -05:00
Trez.One 24cbb9de45 Init output. 2025-11-05 20:39:58 -05:00
Trez.One cb06d3fe71 Clearing Tofu cache for provider refresh. 2025-11-05 20:39:58 -05:00
Trez.One 6da1b8538c Expanding Tofu init step. 2025-11-05 20:39:58 -05:00
Trez.One 34408061cb Dir tshooting. 2025-11-05 20:39:58 -05:00
Trez.One a5f1e63478 Dir tshooting. 2025-11-05 20:39:58 -05:00
Trez.One 5b5ec6ca91 tfplan location. 2025-11-05 20:39:58 -05:00
Trez.One 4d71130361 Still tweaking the PR comment step... 2025-11-05 20:39:58 -05:00
Trez.One 8f597d6b09 Still tweaking the PR comment step... 2025-11-05 20:39:58 -05:00
Trez.One 120b147843 Switching comment action to custom one. 2025-11-05 20:39:58 -05:00
Trez.One 089d978e33 Changing comment step. 2025-11-05 20:39:58 -05:00
Trez.One fa900a9003 Removing some unused CNAMEs. 2025-11-05 20:39:58 -05:00
Trez.One d71e8cff7c Merge pull request 'chore: Configure Renovate' (#9) from renovate/configure into main
Renovate / renovate (push) Failing after 5m19s
Reviewed-on: #9
2025-11-04 14:40:39 -05:00
Trez.One 2c68d78808 Config fix. 2025-11-04 14:29:02 -05:00
Trez.One 5b5e77aa6f Renovate configuration. 2025-11-04 14:27:54 -05:00
Renovate Bot b0a3cbcbdd 🔧 Renovate: add renovate.json 2025-11-04 19:23:22 +00:00
Trez.One 7cb4de9e90 Nuking Renovate config for refresh.
Renovate / renovate (push) Failing after 40s
2025-11-04 14:19:10 -05:00
Trez.One 9df9697a16 Cloudflare resources.
Renovate / renovate (push) Successful in 3m38s
2025-11-03 17:01:13 -05:00
Trez.One a1a954fa29 TF import file. 2025-11-03 17:00:52 -05:00
Trez.One 9393dae27c Renaming workflow.
Renovate / renovate (push) Failing after 1m0s
2025-11-03 16:37:14 -05:00
Trez.One 3381063b06 Merge pull request 'Adding approval and apply steps for testing.' (#7) from initial-workflows_2025-10-17T20-10-31 into main
Renovate / renovate (push) Successful in 5m4s
Reviewed-on: #7

Will need to rewrite approval step in future.
2025-11-03 10:51:47 -05:00
Trez.One d9c037f280 Enabling Terraform manager. 2025-10-17 08:59:22 -04:00
Renovate Bot 997ca4b581 Add renovate.json 2025-09-21 17:26:25 +00:00
5 changed files with 2844 additions and 190 deletions
-188
View File
@@ -1,188 +0,0 @@
name: Auto-PR Check/Creation and TF/OpenTofu Plan
on:
workflow_dispatch:
push:
branches-ignore:
- "main"
- "renovate/**"
paths:
- "cloudflare/**"
env:
OPENTOFU_VERSION: "1.10.6"
HC_VAULT_VERSION: "1.20.4"
TEA_VERSION: "0.10.1"
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
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setting Vault Token
run: echo "VAULT_TOKEN=${{ secrets.VAULT_GITEA_TOKEN }}" >> $GITHUB_ENV
- name: Gotify Notification - Start
uses: eikendev/gotify-action@master
with:
gotify_api_base: ${{ secrets.RUNNER_GOTIFY_URL }}
gotify_app_token: ${{ secrets.RUNNER_GOTIFY_TOKEN }}
notification_title: "GITEA: PR Check @ Rinoa"
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 }}
token: ${{ secrets.BOT_GITEA_TOKEN }}
pr-label: "docker-compose,manual"
assignee: ${{ github.actor }}
- name: Gotify Notification - Done
uses: eikendev/gotify-action@master
with:
gotify_api_base: ${{ secrets.RUNNER_GOTIFY_URL }}
gotify_app_token: ${{ secrets.RUNNER_GOTIFY_TOKEN }}
notification_title: "GITEA: PR Check @ Rinoa"
notification_message: "PR Check done 🎟️"
plan-approval:
name: OpenTofu Plan
needs: check-and-create-pr
runs-on: ubuntu-latest
env:
VAULT_TOKEN: ${{ secrets.VAULT_GITEA_TOKEN }}
outputs:
tofu-cloudflare-plan: ${{ steps.tofu_plan.outputs.plan-output }}
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: Generate .env from Hashicorp Vault
uses: https://git.trez.wtf/Trez/hc-vault-env@main
with:
HC_VAULT_VERSION: ${{ env.HC_VAULT_VERSION }}
HC_VAULT_ADDR: ${{ secrets.TREZ_VAULT_ADDR }}
HC_VAULT_AUTH: token
HC_VAULT_TOKEN: ${{ env.VAULT_TOKEN }}
HC_VAULT_SECRETS_PATH: tar-valon-terraform/env
ENV_FILE_NAME: cloudflare/.env
- name: Export env vars from Vault .env
id: env-vault-vars
run: |
sed -i 's/[\"'\'']//g' cloudflare/.env
set -a
source cloudflare/.env
set +a
while IFS='=' read -r key value; do
if [[ -n "$key" ]]; then
echo "$key=$value" >> $GITHUB_ENV
fi
done < cloudflare/.env
repo_name=$(echo "${{ github.repository }}" | awk -F"/" '{print $2}')
echo "repo_name=$repo_name" >> "$GITHUB_OUTPUT"
- name: Run tofu init
uses: dnogu/tofu-init@v1
with:
working-directory: .
chdir: cloudflare
- name: Tofu Plan
id: tofu_plan
continue-on-error: true
uses: dnogu/tofu-plan@v1
with:
working-directory: .
chdir: cloudflare
out: cloudflare.tfplan
- name: Build Markdown PR comment from plan file
run: |
mkdir -p tmp
{
echo "## 🧩 OpenTofu Plan — Cloudflare"
echo "**Branch:** \`${{ github.ref_name }}\`"
echo "**Exit Code:** \`${{ steps.tofu_plan.outputs.exitcode }}\`"
echo "**Working Directory:** \`cloudflare\`"
echo ""
echo "<details><summary>🪶 Click to expand full plan output</summary>"
echo ""
echo '```hcl'
cat ${GITHUB_WORKSPACE}/cloudflare/cloudflare.tfplan # <-- read file directly, ACT-safe
echo '```'
echo ""
echo "</details>"
echo ""
echo "*(This plan was automatically generated by the workflow.)*"
} > tmp/tofu-plan.md
echo "Markdown PR comment built: tmp/tofu-plan.md"
- name: Comment full Tofu Plan on PR (Gitea safe)
uses: https://git.trez.wtf/Trez.One/git-auto-comment@main
with:
platform: gitea
api_url: https://git.trez.wtf/api/v1
token: ${{ secrets.BOT_GITEA_TOKEN }}
pr_index: ${{ needs.check-and-create-pr.outputs.pr_number }}
repo_owner: ${{ github.repository_owner }}
repo_name: ${{ steps.env-vault-vars.outputs.repo_name }}
comment_template_path: tmp/tofu-plan.md
- name: Wait for manual approval
uses: trstringer/manual-approval@v1
with:
secret: ${{ secrets.BOT_GITEA_TOKEN }}
approvers: WTF
minimum-approvals: 1
issue-title: "Tofu Plan for ${{ needs.check-and-create-pr.outputs.pr_number }}"
issue-body: "Please approve or deny the deployment of the below Tofu plan"
issue-body-file-path: cloudflare/cloudflare.tfplan
exclude-workflow-initiator-as-approver: false
fail-on-denial: true
# apply:
# name: Apply Tofu Plan
# needs: plan-approval
# runs-on: ubuntu-latest
# if: ${{ needs.plan-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: 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
@@ -0,0 +1,328 @@
name: Auto-PR Check/Creation and TF/OpenTofu Plan
on:
workflow_dispatch:
push:
branches-ignore:
- "main"
- "renovate/**"
paths:
- "cloudflare/**"
env:
OPENTOFU_VERSION: "1.10.6"
HC_VAULT_VERSION: "1.20.4"
TEA_VERSION: "0.10.1"
jobs:
check-and-create-pr:
name: Check and Create PR
outputs:
pr_number: ${{ steps.pr-check-create.outputs.pr_number }}
pr_url: ${{ steps.pr-check-create.outputs.pr_url }}
pr_comments_url: ${{ steps.pr-check-create.outputs.pr_comments_url }}
pr_comment_id: ${{ steps.pr-check-create.outputs.pr_comment_id }}
pr_comment_uri: ${{ steps.pr-check-create.outputs.pr_comment_uri }}
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setting Vault Token
run: echo "VAULT_TOKEN=${{ secrets.VAULT_GITEA_TOKEN }}" >> $GITHUB_ENV
- name: Gotify Notification - Start
uses: eikendev/gotify-action@0.0.3
with:
gotify_api_base: ${{ secrets.RUNNER_GOTIFY_URL }}
gotify_app_token: ${{ secrets.RUNNER_GOTIFY_TOKEN }}
notification_title: "GITEA: PR Check @ Rinoa"
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 }}
token: ${{ secrets.BOT_GITEA_TOKEN }}
pr-label: "opentofu,manual"
assignee: ${{ github.actor }}
- name: Gotify Notification - Done
uses: eikendev/gotify-action@0.0.3
with:
gotify_api_base: ${{ secrets.RUNNER_GOTIFY_URL }}
gotify_app_token: ${{ secrets.RUNNER_GOTIFY_TOKEN }}
notification_title: "GITEA: PR Check @ Rinoa"
notification_message: "PR Check done 🎟️"
plan-approval:
name: OpenTofu Plan and Approval
needs: check-and-create-pr
runs-on: ubuntu-latest
env:
PR_NUMBER: ${{ needs.check-and-create-pr.outputs.pr_number }}
PR_URL: ${{ needs.check-and-create-pr.outputs.pr_url }}
PR_COMMENTS_URL: ${{ needs.check-and-create-pr.outputs.pr_comments_url }}
PR_COMMENT_ID: ${{ needs.check-and-create-pr.outputs.pr_comment_id }}
PR_COMMENT_URI: ${{ needs.check-and-create-pr.outputs.pr_comment_uri }}
VAULT_TOKEN: ${{ secrets.VAULT_GITEA_TOKEN }}
outputs:
tofu-cloudflare-plan: ${{ steps.tofu_plan.outputs.plan-output }}
approval_status: ${{ steps.tf-plan-approval.outputs.approval_status }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Gotify Notification
uses: eikendev/gotify-action@ca0339b85ee8db9fda9c0718aaa7f95e17b3c617 # 0.0.4
with:
gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}"
gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}"
notification_title: "GITEA: Terraform/OpenTofu"
notification_message: "Starting plan..."
- name: Setup OpenTofu
uses: opentofu/setup-opentofu@v1.0.6
with:
version: ${{ env.OPENTOFU_VERSION }}
tofu_wrapper: true
- name: Generate .env from Hashicorp Vault
uses: https://git.trez.wtf/Trez/hc-vault-env@main
with:
HC_VAULT_VERSION: ${{ env.HC_VAULT_VERSION }}
HC_VAULT_ADDR: ${{ secrets.TREZ_VAULT_ADDR }}
HC_VAULT_AUTH: token
HC_VAULT_TOKEN: ${{ env.VAULT_TOKEN }}
HC_VAULT_SECRETS_PATH: tar-valon-terraform/env
ENV_FILE_NAME: cloudflare/.env
- name: Export env vars from Vault .env
id: env-vault-vars
run: |
sed -i 's/[\"'\'']//g' cloudflare/.env
set -a
source cloudflare/.env
set +a
while IFS='=' read -r key value; do
if [[ -n "$key" ]]; then
echo "$key=$value" >> $GITHUB_ENV
fi
done < cloudflare/.env
repo_name=$(echo "${{ github.repository }}" | awk -F"/" '{print $2}')
echo "repo_name=$repo_name" >> "$GITHUB_OUTPUT"
- name: Run tofu init
id: tofu-init
uses: dnogu/tofu-init@v1
with:
working-directory: .
chdir: cloudflare
- name: Strip ANSI codes
id: plain-tofu-init
uses: marcransome/remove-ansi-colors@v1.7.56
with:
colored: ${{ steps.tofu-init.outputs.init-output }}
- 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: init
commenter_input: ${{ steps.plain-tofu-init.outputs.uncolored }}
commenter_exitcode: ${{ steps.tofu-init.outputs.exitcode }}
git_token: ${{ secrets.BOT_GITEA_TOKEN }}
pr_comments_url: ${{ env.PR_COMMENTS_URL }}
working_directory: cloudflare
- name: Tofu Plan
id: tofu-plan
continue-on-error: true
uses: dnogu/tofu-plan@v1
with:
working-directory: .
chdir: cloudflare
out: cloudflare.tfplan
- name: Upload Tofu Plan as artifact
uses: https://github.com/christopherHX/gitea-upload-artifact@v4
with:
name: cloudflare-tfplan
path: cloudflare/cloudflare.tfplan
- name: Strip ANSI codes
id: plain-tofu-plan
uses: marcransome/remove-ansi-colors@v1.7.56
with:
colored: ${{ steps.tofu-plan.outputs.plan-output }}
- 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: |
<details><summary>Tofu Plan (click to expand)</summary>
```terraform
${{ steps.plain-tofu-plan.outputs.uncolored }}
```
</details>
commenter_exitcode: ${{ steps.tofu-plan.outputs.exitcode }}
git_token: ${{ secrets.BOT_GITEA_TOKEN }}
pr_comments_url: ${{ env.PR_COMMENTS_URL }}
working_directory: cloudflare
- name: Gotify Notification
uses: eikendev/gotify-action@ca0339b85ee8db9fda9c0718aaa7f95e17b3c617 # 0.0.4
with:
gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}"
gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}"
notification_title: "GITEA: Terraform/OpenTofu"
notification_message: "Plan completed, awaiting approval..."
- name: Wait for manual approval
id: tf-plan-approval
uses: https://git.trez.wtf/Trez/gitea-manual-approval@main
with:
token: ${{ secrets.BOT_GITEA_TOKEN }}
api_url: ${{ gitea.api_url }}
repo_owner: ${{ github.repository_owner }}
repo_name: ${{ github.event.repository.name }}
reminder_interval: 120
approvers: "Trez.One,gitea-sonarqube-bot"
apprise_api_url: ${{ secrets.APPRISE_URL }}
initial_comment: |
<details><summary>Tofu Plan (click to expand)</summary>
```terraform
${{ steps.plain-tofu-plan.outputs.uncolored }}
```
</details>
- name: Gotify Notification
uses: eikendev/gotify-action@ca0339b85ee8db9fda9c0718aaa7f95e17b3c617 # 0.0.4
with:
gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}"
gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}"
notification_title: "GITEA: Terraform/OpenTofu"
notification_message: "Plan approved 👍🏽"
pr-merge:
name: PR Merge
needs: [check-and-create-pr, plan-approval]
env:
pr_index: ${{ needs.check-and-create-pr.outputs.pr_number }}
if: github.ref != 'refs/heads/main' && ${{ needs.plan-approval.outputs.approval_status == 'approved' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- 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: PR Merge
id: pr_merge
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
echo "Merging PR..."
tea pr m \
--repo ${{ github.repository }} \
--title "Auto Merge of PR ${pr_index} - ${{ github.ref_name }}" \
--message "Merged by ${{ github.actor }}" ${pr_index}
echo "pr_index=${pr_index}" >> $GITHUB_OUTPUT
- name: Gotify Notification
uses: eikendev/gotify-action@ca0339b85ee8db9fda9c0718aaa7f95e17b3c617 # 0.0.4
with:
gotify_api_base: "${{ secrets.RUNNER_GOTIFY_URL }}"
gotify_app_token: "${{ secrets.RUNNER_GOTIFY_TOKEN }}"
notification_title: "GITEA: PR Merge Successful"
notification_message: "PR #${{ steps.pr_merge.outputs.pr_index }} merged."
apply:
name: Apply Tofu Plan
needs: [plan-approval,pr-merge]
runs-on: ubuntu-latest
if: ${{ needs.plan-approval.outputs.approval_status == 'approved' }}
env:
VAULT_TOKEN: ${{ secrets.VAULT_GITEA_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Tofu Plan
uses: https://github.com/ChristopherHX/gitea-download-artifact@v4
with:
name: cloudflare-tfplan
path: cloudflare/cloudflare.tfplan
- name: Setup OpenTofu
uses: opentofu/setup-opentofu@v1.0.6
with:
version: ${{ env.OPENTOFU_VERSION }}
tofu_wrapper: true
- name: Generate .env from Hashicorp Vault
uses: https://git.trez.wtf/Trez/hc-vault-env@main
with:
HC_VAULT_VERSION: ${{ env.HC_VAULT_VERSION }}
HC_VAULT_ADDR: ${{ secrets.TREZ_VAULT_ADDR }}
HC_VAULT_AUTH: token
HC_VAULT_TOKEN: ${{ env.VAULT_TOKEN }}
HC_VAULT_SECRETS_PATH: tar-valon-terraform/env
ENV_FILE_NAME: cloudflare/.env
- name: Export env vars from Vault .env
id: env-vault-vars
run: |
sed -i 's/[\"'\'']//g' cloudflare/.env
set -a
source cloudflare/.env
set +a
while IFS='=' read -r key value; do
if [[ -n "$key" ]]; then
echo "$key=$value" >> $GITHUB_ENV
fi
done < cloudflare/.env
- name: Run tofu init
id: tofu-init
uses: dnogu/tofu-init@v1
with:
working-directory: .
chdir: cloudflare
- name: Run Tofu Apply
uses: dnogu/tofu-apply@v1
with:
working-directory: .
chdir: cloudflare
plan: cloudflare.tfplan
+1 -1
View File
@@ -43,4 +43,4 @@ terraform.rc
*.env*
**/*.txt
**/cloudflare*.tf
**/cloudflare_resource_imp.tf
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -2,7 +2,7 @@ terraform {
required_providers {
signoz = {
source = "signoz/signoz"
version = "0.0.9"
version = "0.0.12"
}
}