Skip to content

Commit cd16a79

Browse files
A publish job that cannot succeed is not a gate, it is noise (#94)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 7caed66 commit cd16a79

1 file changed

Lines changed: 19 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ name: release
33
# Publishes to PyPI when a `v*` tag is pushed. There is no API token anywhere in
44
# this repository or in its secrets: publishing uses PyPI Trusted Publishing
55
# (OIDC), which requires a one-time configuration on PyPI naming this
6-
# repository, this workflow filename, and the `pypi` environment. Until that
7-
# configuration exists the publish step fails closed with an OIDC error rather
8-
# than uploading anything.
6+
# repository, this workflow filename, and the `pypi` environment. Until the
7+
# repository variable PYPI_TRUSTED_PUBLISHING is "true" the publish job is
8+
# skipped rather than attempted — a tag still gets the full build-and-verify
9+
# gate, green, and the release ships however the operator ships it. Flip the
10+
# variable once the PyPI side exists and tags publish themselves; if it is
11+
# flipped without that configuration, the job still fails closed on the OIDC
12+
# exchange rather than uploading anything.
913

1014
on:
1115
push:
@@ -139,8 +143,18 @@ jobs:
139143
name: publish to PyPI
140144
needs: build
141145
runs-on: ubuntu-latest
142-
# Tags only. A manual dry run builds and verifies but never uploads.
143-
if: startsWith(github.ref, 'refs/tags/')
146+
# Tags only — and only once Trusted Publishing is actually configured.
147+
# Until the one-time PyPI setup exists, this job cannot succeed: it fails
148+
# closed on the OIDC exchange, which painted every tagged release red
149+
# (v0.1.3, v0.1.4) while the release itself went out by hand. A job that
150+
# is known in advance to fail is not a gate, it is noise that teaches
151+
# people to ignore red. So the job now runs only when the repository
152+
# variable PYPI_TRUSTED_PUBLISHING is set to "true" — flip it in
153+
# Settings -> Secrets and variables -> Actions -> Variables after
154+
# configuring this repo, this workflow filename and the `pypi`
155+
# environment on PyPI. A manual dry run builds and verifies but never
156+
# uploads, exactly as before.
157+
if: startsWith(github.ref, 'refs/tags/') && vars.PYPI_TRUSTED_PUBLISHING == 'true'
144158
environment:
145159
name: pypi
146160
url: https://pypi.org/p/grapharc

0 commit comments

Comments
 (0)