From 3bfdecb3d96ba7201c0ef9f96a0ef8133387d1c7 Mon Sep 17 00:00:00 2001 From: konstin Date: Mon, 20 Apr 2026 15:34:42 -0400 Subject: [PATCH 1/3] Don't block PRs on linkcheck Fixes https://github.com/pypa/packaging.python.org/issues/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 https://github.com/pypa/packaging.python.org/pull/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 (https://github.com/pypa/packaging.python.org/issues/1998#issuecomment-4002461573), 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. --- .github/workflows/linkcheck.yml | 51 +++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 1 - 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/linkcheck.yml diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml new file mode 100644 index 000000000..363aa5331 --- /dev/null +++ b/.github/workflows/linkcheck.yml @@ -0,0 +1,51 @@ +name: Test + +on: + push: + branches-ignore: + - gh-readonly-queue/** # Temporary merge queue-related GH-made branches + pull_request: + types: + - opened # default + - synchronize # default + - reopened # default + - ready_for_review # used in PRs created from GitHub Actions workflows + schedule: + - cron: '0 0 * * *' # Run daily at midnight UTC + workflow_call: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +permissions: {} + +jobs: + build: + name: linkcheck + if: ${{ github.repository_owner == 'pypa' }} + runs-on: ubuntu-latest + timeout-minutes: 20 + + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + persist-credentials: false + + - name: Set up Python + uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + with: + python-version: "3.11" + cache: 'pip' + cache-dependency-path: 'requirements.txt' + + - name: Install dependencies + run: | + python -m pip install --upgrade nox virtualenv + + - name: Nox linkcheck + env: + # Authenticate github.com requests during linkcheck to avoid rate limits. + GITHUB_TOKEN: ${{ github.token }} + run: | + python -m nox -s linkcheck diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8d230d6ba..60de1cb52 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,7 +29,6 @@ jobs: matrix: noxenv: - build - - linkcheck steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 From 3dcce6830e8a523dd6316d8c35d3438042d9e565 Mon Sep 17 00:00:00 2001 From: konstin Date: Mon, 20 Apr 2026 15:42:51 -0400 Subject: [PATCH 2/3] Separate cancel group --- .github/workflows/linkcheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index 363aa5331..9d14b3938 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -15,7 +15,7 @@ on: workflow_call: concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-linkcheck cancel-in-progress: true permissions: {} From efca0b63dfd2ee95786bc68b4c6f80a6324f32a3 Mon Sep 17 00:00:00 2001 From: konstin Date: Tue, 21 Apr 2026 09:54:10 -0400 Subject: [PATCH 3/3] Remove unused github token from test.yml --- .github/workflows/test.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 60de1cb52..5f018615e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,9 +47,6 @@ jobs: python -m pip install --upgrade nox virtualenv - name: Nox ${{ matrix.noxenv }} - env: - # Authenticate github.com requests during linkcheck to avoid rate limits. - GITHUB_TOKEN: ${{ github.token }} run: | python -m nox -s ${{ matrix.noxenv }}