Skip to content

Commit 3bfdecb

Browse files
committed
Don't block PRs on linkcheck
Fixes pypa#1998 Currently, linkcheck is blocking PRs if any link in the project isn't accessible. Due to the high number of links, this regularly blocks unrelated PRs (see pypa#2018 for a recent example). This PR moves linkcheck to a separate, non-blocking check. It will still run on PRs and report a failure if a newly added link 404s (pypa#1998 (comment)), but an unrelated failure won't block PRs anymore. We also run the check on a daily cron, so that links going away is surfaced separately from PRs.
1 parent a86fed2 commit 3bfdecb

2 files changed

Lines changed: 51 additions & 1 deletion

File tree

.github/workflows/linkcheck.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- gh-readonly-queue/** # Temporary merge queue-related GH-made branches
7+
pull_request:
8+
types:
9+
- opened # default
10+
- synchronize # default
11+
- reopened # default
12+
- ready_for_review # used in PRs created from GitHub Actions workflows
13+
schedule:
14+
- cron: '0 0 * * *' # Run daily at midnight UTC
15+
workflow_call:
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
19+
cancel-in-progress: true
20+
21+
permissions: {}
22+
23+
jobs:
24+
build:
25+
name: linkcheck
26+
if: ${{ github.repository_owner == 'pypa' }}
27+
runs-on: ubuntu-latest
28+
timeout-minutes: 20
29+
30+
steps:
31+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
32+
with:
33+
persist-credentials: false
34+
35+
- name: Set up Python
36+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
37+
with:
38+
python-version: "3.11"
39+
cache: 'pip'
40+
cache-dependency-path: 'requirements.txt'
41+
42+
- name: Install dependencies
43+
run: |
44+
python -m pip install --upgrade nox virtualenv
45+
46+
- name: Nox linkcheck
47+
env:
48+
# Authenticate github.com requests during linkcheck to avoid rate limits.
49+
GITHUB_TOKEN: ${{ github.token }}
50+
run: |
51+
python -m nox -s linkcheck

.github/workflows/test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ jobs:
2929
matrix:
3030
noxenv:
3131
- build
32-
- linkcheck
3332

3433
steps:
3534
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

0 commit comments

Comments
 (0)