chore: modify test action
[skip ci]
This commit is contained in:
parent
1c3ba8f65e
commit
3ff3a0355c
2 changed files with 21 additions and 19 deletions
37
.github/actions/notify/action.yaml
vendored
37
.github/actions/notify/action.yaml
vendored
|
|
@ -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' }}" \
|
||||
|
|
|
|||
3
.github/workflows/tf-acc-test.yaml
vendored
3
.github/workflows/tf-acc-test.yaml
vendored
|
|
@ -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) }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue