Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,9 @@ jobs:
echo "Total URLs to be downloaded: $total_urls"

- name: Download Website
id: download
continue-on-error: true
run: |
# Set higher wait seconds for discourse community to avoid 429 rate limit errors
if [ "${{ matrix.website }}" = "community.ultralytics.com" ]; then
WAIT=1
else
WAIT=0.001
fi

# Download all URLs
wget \
--compression=auto \
Expand All @@ -111,7 +105,7 @@ jobs:
--input-file=urls.txt \
--no-clobber \
--no-parent \
--wait=$WAIT \
--wait=0.001 \
--random-wait \
--tries=3 \
--no-verbose \
Expand All @@ -120,13 +114,11 @@ jobs:
- name: Check image sizes
if: github.event_name != 'workflow_dispatch' || inputs.check_images
id: image_sizes
continue-on-error: true
run: python utils/check_image_sizes.py "${{ matrix.website }}" "${{ matrix.website }}"

- name: Check spelling
if: github.event_name != 'workflow_dispatch' || inputs.check_spelling
if: ${{ !cancelled() && steps.download.conclusion == 'success' && (github.event_name != 'workflow_dispatch' || inputs.check_spelling) }}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 MEDIUM: Download Website still has continue-on-error: true, so GitHub sets its conclusion to success even when wget fails. These guards therefore still run spelling and link checks against a partial download, potentially letting the workflow pass without checking the full site. Check steps.download.outcome instead in both this condition and the link-check condition; the image-size step is also currently allowed to run after a failed download.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional, no change. wget exits non-zero whenever any sitemap URL errors (www hit exit code 8 on 2026-09-21 through 09-24), which is why Download Website keeps continue-on-error: the checks should run on the pages that did download, as they do on main today. Gating on outcome would skip the www spelling and link checks entirely on those days. conclusion == 'success' only means the download step ran, i.e. setup succeeded, so checks are skipped only when nothing was downloaded. The image-size step keeps its implicit success() gate, which is equivalent.

id: codespell
continue-on-error: true
run: |
# Install codespell
uv pip install --system codespell
Expand Down Expand Up @@ -183,7 +175,7 @@ jobs:
echo "No spelling errors found ✅"

- name: Check broken links
if: github.event_name != 'workflow_dispatch' || inputs.check_links
if: ${{ !cancelled() && steps.download.conclusion == 'success' && (github.event_name != 'workflow_dispatch' || inputs.check_links) }}
id: lychee
uses: ultralytics/actions/retry@main
with:
Expand All @@ -195,7 +187,6 @@ jobs:
downloaded_files=$(find ${{ matrix.website }} -type f | wc -l)
echo "Scanning $downloaded_files downloaded pages for broken links..."

rm -rf .lycheecache
lychee \
--scheme 'https' \
--timeout 60 \
Expand All @@ -204,7 +195,6 @@ jobs:
--exclude-all-private \
--exclude 'https?://([a-zA-Z0-9-]+\.)*(linkedin\.com|twitter\.com|x\.com|instagram\.com|kaggle\.com|tiktok\.com|fonts\.gstatic\.com|fonts\.googleapis\.com|url\.com|tesla\.com|wellfound\.com|fda\.gov|ieee\.org|sciencedirect\.com|mckinsey\.com|st\.com|adobe\.com|dhl\.com|avangrid\.com|bhp\.com|businesswire\.com|bmw\.in|intuit\.com|epo\.org|orangepi\.org|gdpr\.eu|mvtec\.com|cv-foundation\.org|ntrs\.nasa\.gov|elib\.dlr\.de|burrsettles\.com|biomecardio\.com|glaze\.cs\.uchicago\.edu|miquido\.com|forensicexpertinvestigation\.com|newspace\.co\.in|agriplanting\.com|revistafuera\.com|ravindersingal\.com|qsdca\.com\.au|videologicanalytics\.com|gitee\.com|chemistryworld\.com|aegistechnologies\.com)([:/?#]|$)' \
--exclude '(\.run\.app|\.cloudfunctions\.net|0\.0\.0\.0:5543/predict/from_files)' \
--exclude-path './**/ci.yml' \
--github-token ${{ secrets.GITHUB_TOKEN }} \
--header "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.6478.183 Safari/537.36" \
--header "Accept: */*" \
Expand Down Expand Up @@ -258,7 +248,7 @@ jobs:
echo "EOF" >> $GITHUB_ENV

# Raise error only if 4xx errors remain (not network errors, timeouts, or server errors)
if grep -v "^\[TIMEOUT\]" summary.txt | grep -v "^\[ERROR\]" | grep -v "^Error:" | grep -qE "^\[4[0-9]{2}\]"; then
if grep -qE "^\[4[0-9]{2}\]" summary.txt; then
exit 1
fi

Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/links_local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ jobs:
retry_delay_seconds: 3
retries: 2
run: |
rm -rf .lycheecache
lychee \
--scheme 'https' \
--extensions md,html \
Expand All @@ -58,7 +57,6 @@ jobs:
--exclude-all-private \
--exclude 'https?://([a-zA-Z0-9-]+\.)*(linkedin\.com|twitter\.com|x\.com|instagram\.com|kaggle\.com|tiktok\.com|fonts\.gstatic\.com|fonts\.googleapis\.com|url\.com|tesla\.com|wellfound\.com|fda\.gov|ieee\.org|sciencedirect\.com|mckinsey\.com|st\.com|adobe\.com|dhl\.com|avangrid\.com|bhp\.com|businesswire\.com|bmw\.in|intuit\.com|epo\.org|orangepi\.org|gdpr\.eu|mvtec\.com|cv-foundation\.org|ntrs\.nasa\.gov|elib\.dlr\.de|burrsettles\.com|biomecardio\.com|glaze\.cs\.uchicago\.edu|miquido\.com|forensicexpertinvestigation\.com|newspace\.co\.in|agriplanting\.com|revistafuera\.com|ravindersingal\.com|qsdca\.com\.au|videologicanalytics\.com|gitee\.com|chemistryworld\.com|aegistechnologies\.com)([:/?#]|$)' \
--exclude '(/\$|%7B|api\.indexnow\.org)' \
--exclude-path './**/ci.yml' \
--github-token ${{ secrets.GITHUB_TOKEN }} \
--header "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.6478.183 Safari/537.36" \
.
Expand All @@ -71,7 +69,6 @@ jobs:
retry_delay_seconds: 3
retries: 2
run: |
rm -rf .lycheecache
lychee \
--scheme 'https' \
--extensions md,html,yml,yaml,py,ipynb \
Expand All @@ -81,7 +78,6 @@ jobs:
--exclude-all-private \
--exclude 'https?://([a-zA-Z0-9-]+\.)*(linkedin\.com|twitter\.com|x\.com|instagram\.com|kaggle\.com|tiktok\.com|fonts\.gstatic\.com|fonts\.googleapis\.com|url\.com|tesla\.com|wellfound\.com|fda\.gov|ieee\.org|sciencedirect\.com|mckinsey\.com|st\.com|adobe\.com|dhl\.com|avangrid\.com|bhp\.com|businesswire\.com|bmw\.in|intuit\.com|epo\.org|orangepi\.org|gdpr\.eu|mvtec\.com|cv-foundation\.org|ntrs\.nasa\.gov|elib\.dlr\.de|burrsettles\.com|biomecardio\.com|glaze\.cs\.uchicago\.edu|miquido\.com|forensicexpertinvestigation\.com|newspace\.co\.in|agriplanting\.com|revistafuera\.com|ravindersingal\.com|qsdca\.com\.au|videologicanalytics\.com|gitee\.com|chemistryworld\.com|aegistechnologies\.com)([:/?#]|$)' \
--exclude '(/\$|%7B|api\.indexnow\.org)' \
--exclude-path './**/ci.yml' \
--github-token ${{ secrets.GITHUB_TOKEN }} \
--header "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.6478.183 Safari/537.36" \
.
10 changes: 4 additions & 6 deletions utils/check_image_sizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,10 @@ def get_size(url):

# Collect all image data
all_images = []
with requests.Session() as session:
session.headers.update(HEADERS)
with ThreadPoolExecutor(max_workers=max_workers) as executor:
for url, size, fmt in executor.map(get_size, unique_images.keys()):
if size:
all_images.append((size / 1024, fmt, len(unique_images[url]), url))
with ThreadPoolExecutor(max_workers=max_workers) as executor:
for url, size, fmt in executor.map(get_size, unique_images.keys()):
if size:
all_images.append((size / 1024, fmt, len(unique_images[url]), url))

all_images.sort(reverse=True)

Expand Down
Loading