fix: address mirror review feedback

- scope mirror-token to the mirror host and send it verbatim
- route non-repo mirrors straight to the URL fetch instead of throwing
- authenticate the manifest fetch
- warn on slash branches, and on mirror with PyPy/GraalPy
- memoize mirror validation
- exercise the direct-URL path in the E2E job

Addresses https://github.com/actions/setup-python/pull/1302#issuecomment-5202618946

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Ludovic Henry 2026-08-14 18:10:29 +02:00
parent f30f2fee26
commit 0d1135ac81
No known key found for this signature in database
7 changed files with 383 additions and 90 deletions

View file

@ -72,11 +72,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v6
# The refs/heads/ form serves the same manifest as the default mirror but
# deliberately does not match {owner}/{repo}/{branch}, so this exercises
# the direct-URL manifest fetch that the default coordinates skip.
- name: setup-python with explicit mirror
uses: ./
with:
python-version: 3.12
mirror: https://raw.githubusercontent.com/actions/python-versions/main
mirror: https://raw.githubusercontent.com/actions/python-versions/refs/heads/main
- name: Run simple code
run: python -c 'import sys; print(sys.version)'