From 6afce4e05809a42bf75fcb106d55080160ffd77d Mon Sep 17 00:00:00 2001 From: Rick van Hattem Date: Mon, 16 Nov 2026 04:12:49 +0100 Subject: [PATCH 1/2] ci: update sign.yml to the template with the version input --- .github/workflows/sign.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sign.yml b/.github/workflows/sign.yml index 38b1a29..f475156 100644 --- a/.github/workflows/sign.yml +++ b/.github/workflows/sign.yml @@ -16,6 +16,11 @@ on: description: Name of the package on PyPI required: true type: string + version: + description: Version on PyPI, when it differs from the tag without its leading v + required: false + default: '' + type: string request_id: description: Only used by ppt to find this run required: false @@ -39,10 +44,11 @@ jobs: GH_REPO: ${{ github.repository }} TAG: ${{ inputs.tag }} PACKAGE: ${{ inputs.package }} + PYPI_VERSION: ${{ inputs.version }} steps: - name: Validate inputs run: | - if ! [[ "$TAG" =~ ^v?[0-9][0-9A-Za-z.+!-]*$ ]]; then + if ! [[ "$TAG" =~ ^v?[0-9][0-9A-Za-z._+!-]*$ ]]; then echo "Invalid tag input" >&2 exit 1 fi @@ -50,6 +56,10 @@ jobs: echo "Invalid package input" >&2 exit 1 fi + if [ -n "$PYPI_VERSION" ] && ! [[ "$PYPI_VERSION" =~ ^v?[0-9][0-9A-Za-z._+!-]*$ ]]; then + echo "Invalid version input" >&2 + exit 1 + fi - name: Read the release env: @@ -95,7 +105,10 @@ jobs: TAG: str = os.environ['TAG'] PACKAGE: str = os.environ['PACKAGE'] - VERSION: str = TAG[1:] if TAG.startswith('v') else TAG + # The version input when ppt passes one, else the tag without its v. + VERSION: str = os.environ.get('PYPI_VERSION') or ( + TAG[1:] if TAG.startswith('v') else TAG + ) URL_TEMPLATE: str = os.environ.get( 'PYPI_JSON_URL', 'https://pypi.org/pypi/{package}/{version}/json' ) From 61a636fe5cf9a4a2e90deb125b8f3ef0bf131aa7 Mon Sep 17 00:00:00 2001 From: Rick van Hattem Date: Mon, 16 Nov 2026 04:26:55 +0100 Subject: [PATCH 2/2] ci: name the sign job and explain its permissions The template from python-project-tools now passes zizmor --pedantic. --- .github/workflows/sign.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sign.yml b/.github/workflows/sign.yml index f475156..049d178 100644 --- a/.github/workflows/sign.yml +++ b/.github/workflows/sign.yml @@ -35,11 +35,12 @@ concurrency: jobs: sign: + name: Sign the PyPI files of the release runs-on: ubuntu-latest timeout-minutes: 30 permissions: - contents: write - id-token: write + contents: write # upload the bundles and missing files to the release + id-token: write # the OIDC token Sigstore signs with env: GH_REPO: ${{ github.repository }} TAG: ${{ inputs.tag }}