Skip to content

ci, action: tag-only image publish, nu tasks, 0.9.0 action cutover - #340

Open
sweepies wants to merge 4 commits into
mainfrom
fix/ci-action-docs
Open

sweepies wants to merge 4 commits into
mainfrom
fix/ci-action-docs

Conversation

@sweepies

@sweepies sweepies commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Three CI and action fixes.

Release image job: write permissions only on tags

The image job also ran on pull requests that touch the image, with packages: write, id-token: write and attestations: write, while it ran the PR's image:build and image:smoke. Now:

  • image (still named "Container image") builds and smoke-tests with contents: read only. On a tag it uploads what image:push needs as the image artifact: image.tar (the index the smoke test ran), the apk cache, the local packages and the SBOMs.
  • image-publish runs only on push (tags). It downloads that artifact, logs in to GHCR, runs image:push and attests. It is the only job with the package, OIDC and attestation write permissions. image:push still refuses to publish an index other than the tested one.
  • release now needs image-publish and downloads only the dist-* artifacts, so the image artifact never ends up as a release asset.

No new actions, so actions.lock needs no change.

Workflow shell moved into nu tasks

  • release:check-tag <tag> reads patchula-cli's version from cargo metadata --locked instead of picking apart cargo pkgid output.
  • release:smoke <platform> unpacks the platform's archive and checks that patchula --version matches the archive's version exactly (before, it only checked for some semver). The smoke job now checks out the repo and installs nu through mise to run it.
  • action:pin-release looks up the latest release, writes its schema over the tests/action/PatchulaConfig.pkl symlink and sets version in GITHUB_OUTPUT. It clears MISE_ENABLE_TOOLS for its own mise exec, and the workflow sets that variable only on the steps that need it, so the composite action's mise exec never inherits it.

The composite action.yml keeps its bash run: steps, because it runs in other repositories where this repo's tasks don't exist.

Tested locally: release:check-tag passes on v0.9.0 and fails on v0.8.0. release:smoke passes on the real v0.9.0 linux-x64-musl archive and fails when the archive is missing. action:pin-release with stand-in env vars pinned 0.9.0, wrote the schema in place of the symlink and left the root PatchulaConfig.pkl untouched. nu-lint, jactionlint and zizmor are clean.

action.yml: hard cutover to 0.9.0+

I removed the fallback that passed --cache as the SQLite file (releases up to 0.4.0) and the one that keyed the cache by version for releases without patchula cache schema. 0.9.0 is the first release with cache schema (#325). If the installed binary has no working cache schema, whether it came from version or binary, the action now fails the step with an error that names the binary and asks for 0.9.0 or later. The cache key format (…-s<schema>-…) is unchanged, so existing caches still restore. The inputs' descriptions and guide/github-actions.md now give the minimum version.

Follow-ups (not in this PR)

  • The threat model and lockfile guide contradict each other on lockfile tools running repository code. That is fixed by making the tools stop running it, in a separate PR, not by an exception in the threat model.
  • nix gets the installation token (github_token()), not a repository-scoped one. It runs no repository code, but the "credential no wider than its reach" rule may call for a scoped token there, as gh-actions-lock gets.
  • Nothing dropped.

View guided diff Turn on auto-fix

…to nu tasks

The image job ran pull request code with packages, id-token and
attestations write. It now builds and smoke-tests with contents: read and
hands the index, package cache and SBOMs to image-publish, which only tags
run and which alone holds the write permissions. The release job downloads
only the dist-* archives, so the image artifact never becomes a release
asset.

The tag check, the archive smoke test and the Action workflow's release
pin are nu tasks (release:check-tag, release:smoke, action:pin-release)
instead of inline bash.
The action kept fallbacks for releases up to 0.4.0, which took --cache as
the SQLite file, and for releases without patchula cache schema, which it
keyed by version. 0.9.0 is the first release with cache schema; the action
now fails the step with a clear error for an older version or binary and
always passes the cache directory.
The threat model said a repository never runs code, while the lockfile
guide said Bundler, dotnet, uv, Poetry, Yarn and npm do. The threat model
now names those tools, what triggers them, what their code can reach and
which guards still hold, and the lockfiles guide points to it.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
count-patchula 69f0355 Commit Preview URL

Branch Preview URL
Nov 16 2026, 02:12 AM

…hange

Running repository code is not something the threat model makes an exception
for; the tools that would do it are changed instead, in a separate PR.
@sweepies sweepies changed the title ci, action, docs: tag-only image publish, nu tasks, 0.9.0 action cutover, lockfile exception ci, action: tag-only image publish, nu tasks, 0.9.0 action cutover Nov 16, 2026
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