From a7e100854abce342bc1200b18494cbe3397e3971 Mon Sep 17 00:00:00 2001 From: pgijsbertsen <117165507+pgijsbertsen@users.noreply.github.com> Date: Wed, 18 Feb 2026 20:20:21 +0100 Subject: [PATCH] edit --- .../workflows/tofu-plan-k8s-wheatley.yaml | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/.forgejo/workflows/tofu-plan-k8s-wheatley.yaml b/.forgejo/workflows/tofu-plan-k8s-wheatley.yaml index 50f7d79..8074916 100644 --- a/.forgejo/workflows/tofu-plan-k8s-wheatley.yaml +++ b/.forgejo/workflows/tofu-plan-k8s-wheatley.yaml @@ -1,5 +1,5 @@ --- -name: tofu plan k8s-wheatley +name: Tofu Plan k8s-wheatley on: workflow_dispatch: workflow_call: @@ -53,7 +53,7 @@ jobs: run: tofu plan -no-color continue-on-error: true - - name: Fetch existing comments + - name: Fetch existing comment ID id: fetch run: | response=$(curl -s \ @@ -61,7 +61,7 @@ jobs: "${{ forge.api_url }}/repos/${{ forge.repository }}/issues/$PR_NUMBER/comments") 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" @@ -69,9 +69,12 @@ jobs: id: comment env: COMMENT_BODY: | - #### OpenTofu Format and Style 🖌`${{ steps.fmt.outcome }}` - #### OpenTofu Initialization ⚙️`${{ steps.init.outcome }}` - #### OpenTofu Validation 🤖`${{ steps.validate.outcome }}` + ### ${{ forge.workflow }} + + ${FMT_EMOJI} OpenTofu Format and Style `${{ steps.fmt.outcome }}` + ${INIT_EMOJI} OpenTofu Initialization `${{ steps.init.outcome }}` + ${VALIDATE_EMOJI} OpenTofu Validation `${{ steps.validate.outcome }}` +
Validation Output ``` @@ -90,6 +93,17 @@ jobs:
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") if [ -n "${{ steps.fetch.outputs.comment_id }}" ] && [ "${{ steps.fetch.outputs.comment_id }}" != "null" ]; then