Skip to content

ci(release): pass the repository visibility the publication policy checks - #59

Merged
javiertoledo merged 2 commits into
mainfrom
ci/release-visibility-env
Aug 2, 2026
Merged

ci(release): pass the repository visibility the publication policy checks#59
javiertoledo merged 2 commits into
mainfrom
ci/release-visibility-env

Conversation

@javiertoledo

Copy link
Copy Markdown
Member

The first automatic release — the v0.3.1 run cut by #58 — failed closed at package-release with:

npm publishing is disabled until the repository is public

on a repository that is public. Nothing was published and no tag was written, so v0.3.0 is still the last release and 1478f76 is sitting on main unreleased.

Why

scripts/release.mjs reads visibility from GITHUB_REPOSITORY_VISIBILITY (release.mjs:76) and refuses to publish unless it is public (release.mjs:47). The runner exposes no variable by that name of its own — it has to be passed in.

Two steps never passed it:

  • ci.ymlpackage-releaseValidate the release
  • release.ymlRevalidate the release and its artifact

images.yml:64 does pass it, which is why image publication was never affected and why the omission stayed invisible.

The job-level if: github.event.repository.visibility == 'public' is what hides this. That expression is evaluated by Actions from the event payload, so it is correct and the job starts — and then the policy inside the job reads an unset variable and refuses. The guard and its gate disagreed while both looked right.

The fix

Two env: additions, matching what images.yml already does. Fixing only ci.yml would have moved the identical failure one job downstream into publish-npm's revalidation, so both get it.

Verification

validateReleasePolicy called with the failed release's own inputs:

GITHUB_REPOSITORY_VISIBILITY Result
unset (what CI saw) refuses: npm publishing is disabled until the repository is public
public (what the fix passes) validates

node --test scripts/release.test.mjs 9/9, node guards/run.mjs 2/2, both workflows parse.

Releasing

ci: releases nothing on its own, which is right — nothing here changes what users install. Merging this pushes main, and that run decides from the commits since v0.3.0, which still include #58's feat(image) — so it should cut 0.3.1, the version this run was meant to.

Note docs/releasing.md says to retry the failed jobs in the same run rather than merging again. That cannot work here: that run checks out 1478f76, which does not contain this fix.

Not included

A test asserting the workflows actually pass the variable — the policy is unit-tested, the wiring is not, which is how this shipped. Left out at the author's call.

…ecks

`scripts/release.mjs` reads the repository visibility from
GITHUB_REPOSITORY_VISIBILITY and refuses to publish unless it is `public`. The
runner exposes no such variable of its own, so the two npm-side steps that never
passed it saw it unset and read a public repository as private.

The job-level `if: github.event.repository.visibility == 'public'` hid this: it
is evaluated by Actions, from the event payload, so the job started correctly
and then the policy inside it refused. `images.yml` already passes the variable
explicitly, which is why image publication was never affected.

First observed on the v0.3.1 run for #58, which failed closed at
`package-release` — nothing published, no tag. Fixing only ci.yml would have
moved the same failure into publish-npm's revalidation, so both steps get it.

Verified by calling `validateReleasePolicy` with the release's own inputs: unset
reproduces `npm publishing is disabled until the repository is public`, and
`public` validates.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e9630fded6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/ci.yml
The publication policy is unit-tested and the workflows are asserted on at
length, but nothing connected the two: the integration test hands
GITHUB_REPOSITORY_VISIBILITY straight to the CLI, so it exercises the policy
while bypassing the wiring, and deleting either binding left both suites green.
That is exactly how the v0.3.1 run reached `package-release` before refusing.

Assert the binding on every step that runs `release.mjs validate`, in both
workflows, and add the unset case to the denial table — unset is the mode CI
actually hit, and it is indistinguishable from a private repository to the
policy.

Verified by removing each binding in turn: both make this test fail.

Addresses: #59 (comment)
@javiertoledo
javiertoledo merged commit 73f8877 into main Aug 2, 2026
10 checks passed
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