File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,22 +67,21 @@ jobs:
6767 if-no-files-found : warn
6868 retention-days : 30
6969
70- - name : Notify Slack
71- if : always()
70+ - name : Notify Slack on drift or failure
71+ if : always() && job.status != 'success'
7272 run : |
73- if [ "${{ steps.drift.outputs.exit_code }}" = "2" ]; then
74- EMOJI="🚨"
75- MSG="*Drift detected* in aimock — providers changed response formats. <https://github.com/CopilotKit/aimock/actions/runs/${{ github.run_id }}|View run>"
76- elif [ "${{ job.status }}" = "success" ]; then
77- EMOJI="✅"
78- MSG="Drift tests passed — all providers match."
79- else
80- EMOJI="❌"
81- MSG="*Drift tests failed* (infra error). <https://github.com/CopilotKit/aimock/actions/runs/${{ github.run_id }}|View run>"
73+ if [ -n "${{ secrets.SLACK_WEBHOOK }}" ]; then
74+ if [ "${{ steps.drift.outputs.exit_code }}" = "2" ]; then
75+ EMOJI="🚨"
76+ MSG="*Drift detected* in aimock — providers changed response formats. <https://github.com/CopilotKit/aimock/actions/runs/${{ github.run_id }}|View run>"
77+ else
78+ EMOJI="❌"
79+ MSG="*Drift tests failed* (infra error). <https://github.com/CopilotKit/aimock/actions/runs/${{ github.run_id }}|View run>"
80+ fi
81+ curl -s -X POST "${{ secrets.SLACK_WEBHOOK }}" \
82+ -H "Content-Type: application/json" \
83+ -d "{\"text\": \"${EMOJI} ${MSG}\"}"
8284 fi
83- curl -s -X POST "${{ secrets.SLACK_WEBHOOK }}" \
84- -H "Content-Type: application/json" \
85- -d "{\"text\": \"${EMOJI} ${MSG}\"}"
8685 env :
8786 SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
8887
You can’t perform that action at this time.
0 commit comments