Improve Slack notification (#11458)
* Improve Slack notification * Improve Slack notification * Improve Slack notification
This commit is contained in:
1 parent
8ecc7276ec
commit
22a3cbb97d
3 files changed
+11
-11
No files matched your search
@@ -45,14 +45,6 @@ jobs:
|
||||
python detect.py --weights ${{ matrix.model }}.onnx --img 320
|
||||
python segment/predict.py --weights ${{ matrix.model }}-seg.onnx --img 320
|
||||
python classify/predict.py --weights ${{ matrix.model }}-cls.onnx --img 224
|
||||
- name: Notify on failure
|
||||
if: failure() && github.repository == 'ultralytics/yolov5' && (github.event_name == 'schedule' || github.event_name == 'push')
|
||||
uses: slackapi/slack-github-action@v1.23.0
|
||||
with:
|
||||
payload: |
|
||||
{"text": "<!channel> GitHub Actions error for ${{ github.workflow }} ❌\n\n\n*Repository:* https://github.com/${{ github.repository }}\n*Action:* https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\n*Author:* ${{ github.actor }}\n*Event:* ${{ github.event_name }}\n*Job Status:* ${{ job.status }}\n"}
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_YOLO }}
|
||||
|
||||
Tests:
|
||||
timeout-minutes: 60
|
||||
@@ -159,11 +151,17 @@ jobs:
|
||||
for path in '$m', '$b':
|
||||
model = torch.hub.load('.', 'custom', path=path, source='local')
|
||||
EOF
|
||||
- name: Notify on failure
|
||||
if: failure() && github.repository == 'ultralytics/yolov5' && (github.event_name == 'schedule' || github.event_name == 'push')
|
||||
|
||||
Summary:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [Benchmarks, Tests] # Add job names that you want to check for failure
|
||||
if: always() # This ensures the job runs even if previous jobs fail
|
||||
steps:
|
||||
- name: Check for failure and notify
|
||||
if: ${{ needs.Benchmarks.result == 'failure' || needs.Tests.result == 'failure' }} # Check if any of the jobs failed
|
||||
uses: slackapi/slack-github-action@v1.23.0
|
||||
with:
|
||||
payload: |
|
||||
{"text": "<!channel> GitHub Actions error for ${{ github.workflow }} ❌\n\n\n*Repository:* https://github.com/${{ github.repository }}\n*Action:* https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\n*Author:* ${{ github.actor }}\n*Event:* ${{ github.event_name }}\n*Job Status:* ${{ job.status }}\n"}
|
||||
{"text": "<!channel> GitHub Actions error for ${{ github.workflow }} ❌\n\n\n*Repository:* https://github.com/${{ github.repository }}\n*Action:* https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\n*Author:* ${{ github.actor }}\n*Event:* ${{ github.event_name }}\n"}
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_YOLO }}
|
||||
Reference in new issue
Block a user