From 3ff3a0355c6105d66be6f4bd3f98f2b1b8aa13e6 Mon Sep 17 00:00:00 2001 From: "Marcel S. Henselin" Date: Fri, 27 Mar 2026 10:35:58 +0100 Subject: [PATCH] chore: modify test action [skip ci] --- .github/actions/notify/action.yaml | 37 ++++++++++++++++-------------- .github/workflows/tf-acc-test.yaml | 3 +-- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/.github/actions/notify/action.yaml b/.github/actions/notify/action.yaml index e3ca0499..153bd0b3 100644 --- a/.github/actions/notify/action.yaml +++ b/.github/actions/notify/action.yaml @@ -16,10 +16,10 @@ inputs: required: true default: 'no subtitle provided' - image_url: - description: "The URL of the image to be included in the notification." + image_slug: + description: "The slug of the image to be included in the notification." required: false - default: 'https://cdn.jsdelivr.net/npm/simple-icons@v16/icons/git.svg' + default: 'git' event_author: description: "The author of the event." @@ -53,19 +53,6 @@ inputs: runs: using: "composite" steps: -# - name: event list -# shell: bash -# run: | -# cat <<'EOF' -# ${{ toJSON(github) }} -# EOF -# -# - name: print env -# shell: bash -# run: | -# env -# exit 1 - - name: Install prerequisites shell: bash run: | @@ -75,6 +62,22 @@ runs: apt install -y curl jq echo "::endgroup::" + - name: Determine status color + id: status + shell: bash + run: | + case "${{ inputs.status }}" in + SUCCESS) + STATUS_COLOR="006400/228b22" + ;; + FAILURE) + STATUS_COLOR="8b0000/dc143c" + ;; + *) + STATUS_COLOR="483d8b/6495ed" + ;; + echo "color=${STATUS_COLOR}" >> "$GITHUB_OUTPUT" + - name: Notify via Google Chat Webhook shell: bash env: @@ -85,7 +88,7 @@ runs: PAYLOAD=$(jq -n -r \ --arg header "${{ inputs.title }}" \ --arg subtitle "${{ inputs.subtitle || '' }}" \ - --arg imgurl "${{ inputs.image_url }}" \ + --arg imgurl "https://cdn.simpleicons.org/${{ inputs.image_slug }}/${{ steps.status.outputs.color }}" \ --arg title "${{ inputs.event_title || 'no event title given' }}" \ --arg body "${{ inputs.event_body || 'no event body given' }}" \ --arg author "${{ inputs.event_author || 'no event author given' }}" \ diff --git a/.github/workflows/tf-acc-test.yaml b/.github/workflows/tf-acc-test.yaml index 80b1382c..58a787b4 100644 --- a/.github/workflows/tf-acc-test.yaml +++ b/.github/workflows/tf-acc-test.yaml @@ -51,7 +51,6 @@ jobs: event_body: ${{ inputs.test_file }} event_number: ${{ github.run_id }} event_url: "https://tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview/actions/runs/${{ forgejo.run_number }}" - image_url: 'https://cdn.simpleicons.org/git/483d8b' - name: Run Test (workflow dispatch) if: ${{ github.event_name == 'workflow_dispatch' }} @@ -97,4 +96,4 @@ jobs: event_body: "${{ steps.automatic_run.outputs.result || steps.manual_run.outputs.result }}" event_number: ${{ github.event.id }} event_url: "https://tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview/actions/runs/${{ forgejo.run_number }}" - image_url: ${{ (steps.manual_run.outputs.status || steps.automatic_run.outputs.status) != 'SUCCESS' && 'https://cdn.simpleicons.org/git/8b0000/dc143c' || 'https://cdn.simpleicons.org/git/006400/228b22' }} + status: ${{ (steps.manual_run.outputs.status || steps.automatic_run.outputs.status) }}