From 78daef4b2316e144372561430cfddaa3c7a78054 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Thu, 17 Apr 2025 19:56:14 +0200 Subject: [PATCH] Update links.yml (#13563) Signed-off-by: Glenn Jocher --- .github/workflows/links.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index 2235c0000..3d871f65a 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -33,7 +33,6 @@ jobs: retry_delay_seconds: 60 retries: 2 run: | - set -o pipefail # preserve exit code from lychee command in pipeline lychee \ --scheme 'https' \ --timeout 60 \ @@ -47,6 +46,11 @@ jobs: './**/*.md' \ './**/*.html' | tee -a $GITHUB_STEP_SUMMARY + # Raise error if broken links found + if ! grep -q "0 Errors" $GITHUB_STEP_SUMMARY; then + exit 1 + fi + - name: Test Markdown, HTML, YAML, Python and Notebook links with retry if: github.event_name == 'workflow_dispatch' uses: ultralytics/actions/retry@main @@ -55,7 +59,6 @@ jobs: retry_delay_seconds: 60 retries: 2 run: | - set -o pipefail # preserve exit code from lychee command in pipeline lychee \ --scheme 'https' \ --timeout 60 \ @@ -72,3 +75,8 @@ jobs: './**/*.yaml' \ './**/*.py' \ './**/*.ipynb' | tee -a $GITHUB_STEP_SUMMARY + + # Raise error if broken links found + if ! grep -q "0 Errors" $GITHUB_STEP_SUMMARY; then + exit 1 + fi