Skip to content

Pin the PyPI publish action by tag, not by commit SHA - #175

Merged
isayev merged 1 commit into
mainfrom
fix/publish-action-ref
Aug 21, 2026
Merged

isayev merged 1 commit into
mainfrom
fix/publish-action-ref

Conversation

@isayev

@isayev isayev commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

What happened

The 3.1.0 publish failed 29 seconds in — after a clean build, and before PyPI was ever contacted:

Unable to find image 'ghcr.io/pypa/gh-action-pypi-publish:a892a5a61159132606e93a2fa6f4358831b04d26'
docker: Error response from daemon: manifest unknown

The pin was not stale

a892a5a6 is v1.14.2, the current latest release of the action. The problem is that this is a Docker-based action: it derives its own image reference from whatever ref it was invoked with. The run log shows REF: a892a5a6… becoming ghcr.io/pypa/gh-action-pypi-publish:a892a5a6…, and upstream publishes images tagged by version only.

Verified against the registry rather than inferred:

ref ghcr.io
a892a5a6… (v1.14.2 SHA) 404
2834a314… (v1.14.1 SHA) 404
v1.14.2 200
v1.14.1 200

So SHA-pinning this action could never have worked, for any release.

Why the other pins stay

checkout, setup-python and upload-artifact remain SHA-pinned. They are JavaScript actions, where the ref selects code and SHA-pinning is exactly right. Only the Docker action turns its ref into an image tag. That distinction is now a comment above the step, since "why is this one different" is the obvious review question.

Nothing was published

PyPI's latest is still 3.0.0 and 3.1.0 is absent, so the version number is still free and the release can be re-cut once this lands.

The 3.1.0 publish failed 29s in, after a clean build and before PyPI was
ever contacted:

    Unable to find image
      'ghcr.io/pypa/gh-action-pypi-publish:a892a5a61159132606e93a2fa6f4358831b04d26'
    docker: Error response from daemon: manifest unknown

The pin was not stale -- a892a5a6 IS v1.14.2, the current latest release.
The problem is that this is a DOCKER-based action, and it builds its own
image reference out of whatever ref it was invoked with. The run log shows
`REF: a892a5a6...` becoming `ghcr.io/pypa/gh-action-pypi-publish:a892a5a6...`,
and upstream publishes images tagged by VERSION only.

Verified against the registry rather than inferred:

    a892a5a6...  (v1.14.2 SHA)   HTTP 404
    2834a314...  (v1.14.1 SHA)   HTTP 404
    v1.14.2                      HTTP 200
    v1.14.1                      HTTP 200

So SHA-pinning this action could never have worked, for any release.

Every other action in this workflow stays SHA-pinned. checkout,
setup-python and upload-artifact are JavaScript actions, where the ref
selects code and pinning by SHA is exactly right. The distinction is now a
comment above the step, because "why is this one different" is the obvious
review question.

Nothing was published: PyPI's latest is still 3.0.0 and 3.1.0 is absent, so
the version number is still free and the release can be re-cut once this
lands.
@isayev
isayev merged commit a42684f into main Aug 21, 2026
5 checks passed
@isayev
isayev deleted the fix/publish-action-ref branch August 21, 2026 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant