diff --git a/.github/send-notifications.sh b/.github/send-notifications.sh new file mode 100755 index 000000000..cbb90bbe3 --- /dev/null +++ b/.github/send-notifications.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +JSON_PAYLOAD=$(cat < /dev/null diff --git a/.github/workflows/run-notification-main.yml b/.github/workflows/run-notification-main.yml new file mode 100644 index 000000000..c58df3789 --- /dev/null +++ b/.github/workflows/run-notification-main.yml @@ -0,0 +1,13 @@ +name: run notifications + +on: + release: + types: [published] + +jobs: + call-reusable-workflow: + uses: ./.github/workflows/send-notification-reusable.yml + with: + action_name: Released to main + secrets: + webhook_url: ${{ secrets.DEPLOYMENT_WEBHOOK_URL_PROD }} diff --git a/.github/workflows/run-notification-prerelease.yml b/.github/workflows/run-notification-prerelease.yml new file mode 100644 index 000000000..5e1b54198 --- /dev/null +++ b/.github/workflows/run-notification-prerelease.yml @@ -0,0 +1,13 @@ +name: run notifications + +on: + push: + branches: [pre-release] + +jobs: + call-reusable-workflow: + uses: ./.github/workflows/send-notification-reusable.yml + with: + action_name: Pushed to pre-release + secrets: + webhook_url: ${{ secrets.DEPLOYMENT_WEBHOOK_URL_STAGE }} diff --git a/.github/workflows/send-notification-reusable.yml b/.github/workflows/send-notification-reusable.yml new file mode 100644 index 000000000..4a87f44a4 --- /dev/null +++ b/.github/workflows/send-notification-reusable.yml @@ -0,0 +1,30 @@ +name: Send Notification Reusable + +on: + workflow_call: + inputs: + action_name: + required: true + type: string + secrets: + webhook_url: + required: true + +jobs: + sendNotifications: + name: "Send MS-teams notification" + runs-on: ubuntu-24.04 + steps: + - name: "Init env variables" + run: | + echo "WEBHOOK_URL=${{ secrets.webhook_url }}" >> $GITHUB_ENV + echo "ACTION_NAME='${{ inputs.action_name }}'" >> $GITHUB_ENV + echo "PUSHER_NAME=${{ github.event.pusher.name }}" >> $GITHUB_ENV + echo "COMMIT_MESSAGE=${{ github.event.head_commit.message }}" >> $GITHUB_ENV + echo "GITHUB_SHA=${{ github.sha }}" >> $GITHUB_ENV + - name: "Init dependency" + uses: actions/checkout@v4 + - name: "Send notifications" + shell: bash + run: | + ${GITHUB_WORKSPACE}/.github/send-notifications.sh