This is an automated email from the ASF dual-hosted git repository.

rom pushed a commit to branch cicd/add-slack-notifications
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit f05d8e2b040df4b99fd508ed887cefee823ae91c
Author: romsharon98 <[email protected]>
AuthorDate: Sat Sep 21 13:38:49 2024 +0300

    add slack notifier
---
 .github/workflows/ci.yml | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 14fe0bbe4b..868f90e108 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -40,6 +40,7 @@ env:
   GITHUB_USERNAME: ${{ github.actor }}
   IMAGE_TAG: "${{ github.event.pull_request.head.sha || github.sha }}"
   VERBOSE: "true"
+  SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
 
 concurrency:
   group: ci-${{ github.event.pull_request.number || github.ref }}
@@ -669,3 +670,19 @@ jobs:
       include-success-outputs: ${{ 
needs.build-info.outputs.include-success-outputs }}
       docker-cache: ${{ needs.build-info.outputs.docker-cache }}
       canary-run: ${{ needs.build-info.outputs.canary-run }}
+
+  notify-slack-failure:
+    name: "Notify Slack on Failure"
+    # if: failure()
+    runs-on: ["ubuntu-22.04"]
+    steps:
+      - name: Notify Slack
+        run: |
+          curl -X POST -H 'Content-type: application/json' --data '{
+            "text": "The GitLab CI workflow *Tests* has failed.\n
+                    Repository: ${{ github.repository }}\n
+                    Branch: ${{ github.ref_name }}\n
+                    Commit: ${{ github.sha }}\n
+                    Check the details at:
+                    ${{ github.server_url }}/${{ github.repository 
}}/actions/runs/${{ github.run_id }}"
+          }' ${{ env.SLACK_WEBHOOK_URL }}

Reply via email to