Skip to content

Commit

Permalink
Improve Slack notification (ultralytics#11458)
Browse files Browse the repository at this point in the history
* Improve Slack notification

* Improve Slack notification

* Improve Slack notification
  • Loading branch information
glenn-jocher authored and bandakopi committed Jul 20, 2023
1 parent cc3da9e commit 8850eb4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/ci-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
1 change: 1 addition & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name: "CodeQL"
on:
schedule:
- cron: '0 0 1 * *' # Runs at 00:00 UTC on the 1st of every month
workflow_dispatch:

jobs:
analyze:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name: Publish Docker Images
on:
push:
branches: [ master ]
workflow_dispatch:

jobs:
docker:
Expand Down

0 comments on commit 8850eb4

Please sign in to comment.