fix(release): presence is not validity — shape-check credentials in the preflight - #545
Merged
Merged
Conversation
…he preflight
Today's dry run spent 25 minutes per platform discovering that
TAURI_SIGNING_PRIVATE_KEY begins with a SPACE:
failed to decode secret key: failed to decode base64 secret key:
failed to decode base64 key: Invalid symbol 32, offset 0.
ASCII 32, at position 0. That secret was set on 2026-02-16, is non-empty, and
passed every check this workflow has: `gh secret list` shows it, and the
preflight's `require` only tests for emptiness. It had never been exercised
because `createUpdaterArtifacts` was unset until #539, so nothing ever asked
Tauri to decode it. The first release that got far enough to need it would have
died on it — after a full four-platform compile.
The preflight exists precisely so a credential problem costs seconds instead of
45 minutes. It was only checking that credentials are THERE. Now it also checks
they are SHAPED like credentials: no leading or trailing whitespace, on every
value, on every platform.
Deliberately narrow. It does not validate content — that would mean
reimplementing base64, minisign and eSigner's auth here, and a check that is
wrong about a valid credential is worse than no check. Surrounding whitespace is
unambiguous: no credential should ever carry it, and a value pasted with a stray
leading space is exactly the failure that just cost an hour of runner time.
Verified by execution, not by reading. The validator was extracted and run
against fixtures: leading space, trailing space and leading tab are all flagged;
a clean base64 key is not; an EMPTY value is not (absence is `require`'s job,
not this one's); and a password with spaces INSIDE it is not, because that is a
legitimate password and flagging it would break a working release.
`bash -n` over the whole extracted preflight passes.
Not included: an `xcrun notarytool history` probe, which would have caught the
OTHER credential failure this dry run found — Apple rejecting notarization with
"a required agreement is missing or has expired" after a 25-minute macOS build.
It is the obvious next step and worth doing, but it cannot be tested from here
and the release path is the wrong place to put code I have only read.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Today's dry run spent 25 minutes per platform discovering this:
ASCII 32, at position 0 —
TAURI_SIGNING_PRIVATE_KEYbegins with a space.That secret was set on 2026-02-16, is non-empty, and passed every check this repository has.
gh secret listshows it present. The preflight'srequireonly tests for emptiness. And it had never been exercised at all, becausecreateUpdaterArtifactswas unset until #539 — so nothing ever asked Tauri to decode it. The first release that got far enough to need it would have died on it, after a full four-platform compile.The change
The preflight exists precisely so a credential problem costs seconds instead of 45 minutes. It was only checking that credentials are there. Now it also checks they are shaped like credentials: no leading or trailing whitespace, on every value, on every platform.
Deliberately narrow
It does not validate content. That would mean reimplementing base64, minisign and eSigner's auth inside a preflight — and a check that is wrong about a valid credential is worse than no check at all, because it blocks a good release.
Surrounding whitespace is unambiguous: no credential should ever carry it, and a value pasted with a stray leading space is exactly the failure that just cost an hour of runner time.
Verified by execution, not by reading
The validator was extracted and run against fixtures:
require's job, not this one'sbash -nover the whole extracted preflight passes, and YAML re-parses.That last pair matters. I caught a real bug in my own first attempt at this — the shape loop landed inside the
shape()function because my anchor matched the wrongesac. YAML still parsed cleanly, because it is all one block scalar. Only executing the bash found it.Not included
An
xcrun notarytool historyprobe, which would have caught the other credential failure this dry run found — Apple rejecting notarization with "a required agreement is missing or has expired", again after a 25-minute macOS build.It is the obvious next step and worth doing. But it cannot be tested from this machine, and the release path is the wrong place to put code I have only read. Recommended as a follow-up rather than shipped blind.