Skip to content

Commit 2820162

Browse files
authored
Add Slack notification on links CI failure (#10)
1 parent bb820d7 commit 2820162

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/links.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,17 @@ jobs:
6767
retry_wait_seconds: 60
6868
max_attempts: 3
6969
command: lychee --accept 429,999 --exclude-loopback --exclude 'https?://(www\.)?(linkedin\.com|twitter\.com|instagram\.com|kaggle\.com|tiktok\.com|fonts\.gstatic\.com|fonts\.googleapis\.com|url\.com|wellfound\.com|.*\.cloudfunctions\.net|0\.0\.0\.0:5543/predict/from_files)' --exclude-path '**/ci.yaml' --exclude-mail --github-token ${{ secrets.GITHUB_TOKEN }} './ultralytics_website/**/*.html'
70+
71+
Summary:
72+
runs-on: ubuntu-latest
73+
needs: [Links] # Add job names that you want to check for failure
74+
if: always() # This ensures the job runs even if previous jobs fail
75+
steps:
76+
- name: Check for failure and notify
77+
if: needs.Links.result == 'failure' && github.repository == 'ultralytics/docs' && (github.event_name == 'schedule' || github.event_name == 'push')
78+
uses: slackapi/[email protected]
79+
with:
80+
payload: |
81+
{"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"}
82+
env:
83+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_WEBSITE }}

0 commit comments

Comments
 (0)