terraform-provider-stackitp.../.github/workflows/clean_up.yaml
Marcel S. Henselin 413dbd6f50 chore: add notifications
[skip ci]
2026-03-25 13:52:47 +01:00

65 lines
2 KiB
YAML

name: TF Acceptance Test CleanUp
on:
workflow_dispatch:
inputs:
list_only:
description: "only list resources"
type: boolean
default: true
required: true
res_prefix:
description: "resource name prefix"
type: string
default: 'tf-acc-'
required: true
log_level:
description: 'Log Level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
- error
jobs:
clean:
name: Clean up
runs-on: stackit-docker
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Notify Google Chat
if: ${{ always() }} # Use always to ensure that the notification is also send on failure of former steps
uses: SimonScholz/google-chat-action@main
with:
webhookUrl: '${{ secrets.GOOGLE_WEBHOOK_URL }}'
jobStatus: '${{ job.status }}'
title: CI pipeline
subtitle: "on: ${{ github.event_name }} \n<br />with filter prefix: ${{ inputs.res_prefix }}"
- name: Notify
uses: ./.github/actions/notify
with:
webhook_url: ${{ secrets.GOOGLE_WEBHOOK_URL }}
title: CI pipeline started
event_title: ${{ github.event.type }}
event_author: ${{ github.event.actor.login }}
event_body: "Filter: ${{ inputs.res_prefix }}"
event_number: ${{ github.event.id }}
event_url: "https://tf-provider.git.onstackit.cloud/stackit-dev-tools/terraform-provider-stackitprivatepreview/actions/runs/${{ github.run_id }}"
- name: Clean
uses: ./.github/actions/clean_up
with:
project_id: ${{ vars.TF_ACC_PROJECT_ID }}
region: 'eu01'
tf_resource_prefix: ${{ inputs.res_prefix }}
service_account_json_content_b64: "${{ secrets.TF_ACC_SERVICE_ACCOUNT_JSON_B64 }}"
list_only: ${{ inputs.list_only }}
log_level: ${{ inputs.log_level }}