edit
All checks were successful
Tofu Plan k8s-wheatley / tofu-plan-k8s-wheatley (pull_request) Successful in 21s

This commit is contained in:
Peter 2026-02-18 20:20:21 +01:00
parent 012cbaeda2
commit a7e100854a
Signed by: Peter
SSH key fingerprint: SHA256:B5tYaxBExaDm74r1px9iVeZ6F/ZDiyiy9SbBqfZYrvg

View file

@ -1,5 +1,5 @@
--- ---
name: tofu plan k8s-wheatley name: Tofu Plan k8s-wheatley
on: on:
workflow_dispatch: workflow_dispatch:
workflow_call: workflow_call:
@ -53,7 +53,7 @@ jobs:
run: tofu plan -no-color run: tofu plan -no-color
continue-on-error: true continue-on-error: true
- name: Fetch existing comments - name: Fetch existing comment ID
id: fetch id: fetch
run: | run: |
response=$(curl -s \ response=$(curl -s \
@ -61,7 +61,7 @@ jobs:
"${{ forge.api_url }}/repos/${{ forge.repository }}/issues/$PR_NUMBER/comments") "${{ forge.api_url }}/repos/${{ forge.repository }}/issues/$PR_NUMBER/comments")
comment_id=$(echo "$response" | jq -r \ comment_id=$(echo "$response" | jq -r \
'.[] | select(.body | test("OpenTofu Format and Style")) | .id' | head -n 1) '.[] | select(.body | test("${{ forge.workflow }}")) | .id' | head -n 1)
echo "comment_id=$comment_id" echo "comment_id=$comment_id"
@ -69,9 +69,12 @@ jobs:
id: comment id: comment
env: env:
COMMENT_BODY: | COMMENT_BODY: |
#### OpenTofu Format and Style 🖌`${{ steps.fmt.outcome }}` ### ${{ forge.workflow }}
#### OpenTofu Initialization ⚙️`${{ steps.init.outcome }}`
#### OpenTofu Validation 🤖`${{ steps.validate.outcome }}` ${FMT_EMOJI} OpenTofu Format and Style `${{ steps.fmt.outcome }}`
${INIT_EMOJI} OpenTofu Initialization `${{ steps.init.outcome }}`
${VALIDATE_EMOJI} OpenTofu Validation `${{ steps.validate.outcome }}`
<details><summary>Validation Output</summary> <details><summary>Validation Output</summary>
``` ```
@ -90,6 +93,17 @@ jobs:
</details> </details>
run: | run: |
set -euo pipefail
emoji() {
[ "$1" = "success" ] && echo "✅" || echo "❌"
}
export FMT_EMOJI=$(emoji "$FMT_STATUS")
export INIT_EMOJI=$(emoji "$INIT_STATUS")
export VALIDATE_EMOJI=$(emoji "$VALIDATE_STATUS")
export PLAN_EMOJI=$(emoji "$PLAN_STATUS")
payload=$(jq -Rs --arg body "$COMMENT_BODY" '{body: $body}' <<< "$COMMENT_BODY") payload=$(jq -Rs --arg body "$COMMENT_BODY" '{body: $body}' <<< "$COMMENT_BODY")
if [ -n "${{ steps.fetch.outputs.comment_id }}" ] && [ "${{ steps.fetch.outputs.comment_id }}" != "null" ]; then if [ -n "${{ steps.fetch.outputs.comment_id }}" ] && [ "${{ steps.fetch.outputs.comment_id }}" != "null" ]; then