notification #444
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: notification | |
on: | |
workflow_run: | |
workflows: | |
- leanix-k8s-connector | |
types: | |
- completed | |
env: | |
SLACK-CHANNEL: '#team-helios-notifications' | |
jobs: | |
notify: | |
runs-on: ubuntu-latest | |
if: github.event.workflow_run.head_branch == 'main' | |
steps: | |
- name: Send CI/CD pipeline success message | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
uses: archive/github-actions-slack@v2.9.0 | |
with: | |
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_TOKEN }} | |
slack-channel: ${{ env.SLACK-CHANNEL }} | |
slack-text: | | |
:beers: ${{ github.repository }} successfully deployed! More information@ ${{ github.event.workflow_run.html_url }} | |
- name: Send CI/CD pipeline failure message | |
if: ${{ github.event.workflow_run.conclusion == 'failure' }} | |
uses: archive/github-actions-slack@v2.9.0 | |
with: | |
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_TOKEN }} | |
slack-channel: ${{ env.SLACK-CHANNEL }} | |
slack-text: | | |
:no_entry_sign: ${{ github.repository }} failed to deploy! More information@ ${{ github.event.workflow_run.html_url }} |