This commit is contained in:
2025-11-03 09:41:33 -05:00
parent 9620979c8b
commit 370e364144
+8 -14
View File
@@ -27,8 +27,7 @@ jobs:
fetch-depth: 1
- name: Setting Vault Token
run: |
echo "VAULT_TOKEN=${{ secrets.VAULT_GITEA_TOKEN }}" >> $GITHUB_ENV
run: echo "VAULT_TOKEN=${{ secrets.VAULT_GITEA_TOKEN }}" >> $GITHUB_ENV
- name: Gotify Notification - Start
uses: eikendev/gotify-action@master
@@ -87,19 +86,16 @@ jobs:
- name: Export env vars from Vault .env
id: env-vault-vars
run: |
echo "🧩 Cleaning and loading cloudflare/.env into GitHub Actions environment..."
echo "🧩 Cleaning and loading cloudflare/.env..."
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"
@@ -118,14 +114,14 @@ jobs:
chdir: cloudflare
out: cloudflare.tfplan
- name: Save plan output to file (with collapsible Markdown, ACT-safe)
- name: Save raw plan output to file (ACT-safe)
run: |
mkdir -p tmp
# Save raw plan output first
echo "${{ steps.tofu_plan.outputs.plan-output }}" > tmp/tofu-plan-raw.txt
echo "Saved raw plan: tmp/tofu-plan-raw.txt ($(wc -c < tmp/tofu-plan-raw.txt) bytes)"
# Build Markdown file safely
- name: Build Markdown PR comment (ACT-safe)
run: |
{
echo "## 🧩 OpenTofu Plan — Cloudflare"
echo "**Branch:** \`${{ github.ref_name }}\`"
@@ -142,11 +138,9 @@ jobs:
echo ""
echo "*(This plan was automatically generated by the workflow.)*"
} > tmp/tofu-plan.md
echo "Markdown PR comment built: tmp/tofu-plan.md"
echo "Plan file saved: tmp/tofu-plan.md ($(wc -c < tmp/tofu-plan.md) bytes)"
- name: Comment full Tofu Plan on PR (safe)
- name: Comment full Tofu Plan on PR (Gitea safe)
uses: https://git.trez.wtf/Trez.One/git-auto-comment@main
with:
platform: gitea