Compare commits

...
Author SHA1 Message Date
skylartaylor a92e356590 nightly-tests: parse the secrets block to its end and check each source name
Same tree as e5504332, carried forward rather than force-pushed. Answers CodeRabbit: an appended entry after a blank line is now included, and every entry must map NAME to ${{ secrets.NAME }}.
2026-11-26 16:12:27 +01:00
skylartaylor 4a8a1d75fa nightly: carry the re-pin to craft-common-actions 3dee1822 (#376)
Same tree as 91850c5b: both callers, the policy and the docs at 3dee1822, fifteen named secrets forwarded, no environment. Carried forward rather than force-pushed, because the rebase put it beside the branch head instead of on top of it.
2026-11-26 16:07:11 +01:00
skylartaylor 39720da870 nightly: forward the signer's secrets from the caller, and allow just those
The first real signer run (gridcraft 45777141713) passed validate and then every sign job refused:
"LINUX_SIGNING_KEY required", "all six Apple signing/notarization secrets required", "complete Windows
PFX pair or six Azure values required". The cause is structural rather than a settings gap: a reusable
workflow sees only the secrets its caller passes, and the caller cannot obtain environment secrets
because GitHub does not allow `environment:` on a job that calls a reusable workflow ("only name, uses,
with, secrets, needs, if and permissions are allowed"). The release environment's secrets therefore
cannot reach the sign steps by any route we have, which is why stable's caller forwards all of them
explicitly from org-level secrets.

This forwards exactly the fifteen the sign steps read, named, never `inherit`, and relaxes one
trust-closure assertion from "no secrets at all" to "exactly this allowlist" for the signer caller only;
the producer caller is unchanged and still forwards nothing. Behavior is unchanged until the shared
callee declares them (#376), which `uses:` must then pin to.

Open as a DRAFT; do not dispatch. It needs Skylar's yes because it widens a reviewed signing contract,
and it needs the secrets to exist at org or repo level, which the probe showed they do not for this repo.
2026-11-26 08:57:03 +01:00
5 changed files with 66 additions and 14 deletions
+3 -3
View File
@@ -4,10 +4,10 @@
"repository_id": 1408285582,
"producer_workflow_id": 429713469,
"producer_workflow_path": ".github/workflows/nightly.yml",
"producer_tooling_revision": "8389cad8b849ea6bdb5e15fbce16772c3457565a",
"producer_workflow_ref": "storytold/craft-common-actions/.github/workflows/nightly-unsigned.yml@8389cad8b849ea6bdb5e15fbce16772c3457565a",
"producer_tooling_revision": "3dee18226ed28134896f69fb8b280fff9247ec7f",
"producer_workflow_ref": "storytold/craft-common-actions/.github/workflows/nightly-unsigned.yml@3dee18226ed28134896f69fb8b280fff9247ec7f",
"signer_workflow_path": ".github/workflows/nightly-sign.yml",
"signer_tooling_revision": "8389cad8b849ea6bdb5e15fbce16772c3457565a",
"signer_tooling_revision": "3dee18226ed28134896f69fb8b280fff9247ec7f",
"release_branch": "nightly-signer",
"manual_actors": [
"bflatastic",
+21 -5
View File
@@ -34,12 +34,28 @@ jobs:
checks: read
attestations: write
id-token: write
uses: storytold/craft-common-actions/.github/workflows/nightly-release.yml@8389cad8b849ea6bdb5e15fbce16772c3457565a
uses: storytold/craft-common-actions/.github/workflows/nightly-release.yml@3dee18226ed28134896f69fb8b280fff9247ec7f
with:
tooling-revision: 8389cad8b849ea6bdb5e15fbce16772c3457565a
tooling-revision: 3dee18226ed28134896f69fb8b280fff9247ec7f
app-name: gridcraft
producer_run_id: ${{ inputs.producer_run_id }}
producer_run_attempt: ${{ inputs.producer_run_attempt }}
# No secrets: inherit or raw platform values in this caller. Only the isolated native
# callee job may bind the release environment and export its keys; that environment must
# admit nightly-signer alongside release before the first dispatch.
# Forward exactly the secrets the signer's sign steps read, named explicitly (never `inherit`),
# as the stable Release caller does. The callee must declare them; it does since the shared
# change that added them, and `uses:` is pinned to that revision.
secrets:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }}
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_SIGNING_ENDPOINT: ${{ secrets.AZURE_SIGNING_ENDPOINT }}
AZURE_SIGNING_ACCOUNT: ${{ secrets.AZURE_SIGNING_ACCOUNT }}
AZURE_CERT_PROFILE: ${{ secrets.AZURE_CERT_PROFILE }}
LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }}
+2 -2
View File
@@ -22,9 +22,9 @@ jobs:
actions: read
attestations: write
id-token: write
uses: storytold/craft-common-actions/.github/workflows/nightly-unsigned.yml@8389cad8b849ea6bdb5e15fbce16772c3457565a
uses: storytold/craft-common-actions/.github/workflows/nightly-unsigned.yml@3dee18226ed28134896f69fb8b280fff9247ec7f
with:
tooling-revision: 8389cad8b849ea6bdb5e15fbce16772c3457565a
tooling-revision: 3dee18226ed28134896f69fb8b280fff9247ec7f
app-name: gridcraft
manual-actors: '["bflatastic","dylanmtaylor","echelon","FredApps","skylartaylor"]'
craft-fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83
+2 -2
View File
@@ -14,7 +14,7 @@ gh api repos/storytold/gridcraft/actions/workflows/nightly.yml --jq .id
The callers pass no platform secrets. The unsigned reusable caller's maximum OIDC/attestation
permissions are for its isolated attester; its compiler narrows to contents and Actions read
only, with no OIDC, attestation write, release environment or platform signing secrets.
Shared tooling is pinned to `8389cad8b849ea6bdb5e15fbce16772c3457565a`, the craft-common-actions
Shared tooling is pinned to `3dee18226ed28134896f69fb8b280fff9247ec7f`, the craft-common-actions
main commit that merged the signer Windows fix (#375), following the shared work already
reviewed here. Both callers name it in `uses` and `tooling-revision`. A pin is reviewed source
availability, not provider, queue, native signing or crypto qualification.
@@ -63,7 +63,7 @@ any Sonar debt snapshot) before `nightly-signer` is advanced to it.
|---|---|---|
| `repository_id` | `1408285582` | `gh api repos/storytold/gridcraft --jq .id` |
| `producer_workflow_id` | `429713469` | `gh api repos/storytold/gridcraft/actions/workflows/nightly.yml` (path `.github/workflows/nightly.yml`, state `active`) |
| `producer_tooling_revision`, `signer_tooling_revision`, `producer_workflow_ref` | `8389cad8…` (the signer Windows fix (#375)) | The callers' pin |
| `producer_tooling_revision`, `signer_tooling_revision`, `producer_workflow_ref` | `3dee1822…` (the signer Windows fix (#375)) | The callers' pin |
| `manual_actors` / `automatic_signer_actors` | the five release managers / `[]` | release-managers team (id 19837241) members who can push; equals the producer caller's `manual-actors` |
| `max_age_seconds`, `max_artifact_bytes` | `86400`, `2147483648` | Go-live checklist |
| `platforms` | three rows | Suite stable identities (Windows Authenticode publisher subject, Linux OpenPGP release key fingerprint, macOS Apple Developer ID team `DJ6XS33FX8`) |
+38 -2
View File
@@ -10,6 +10,13 @@ import textwrap
import unittest
ROOT = Path(__file__).resolve().parents[1]
# Exactly the secrets the nightly sign steps read; the signer caller may forward these and no others.
SIGNER_SECRETS = {
"LINUX_SIGNING_KEY", "APPLE_CERTIFICATE", "APPLE_CERTIFICATE_PASSWORD", "KEYCHAIN_PASSWORD",
"APPLE_ID", "APPLE_PASSWORD", "APPLE_TEAM_ID", "WINDOWS_CERTIFICATE",
"WINDOWS_CERTIFICATE_PASSWORD", "AZURE_TENANT_ID", "AZURE_CLIENT_ID", "AZURE_CLIENT_SECRET",
"AZURE_SIGNING_ENDPOINT", "AZURE_SIGNING_ACCOUNT", "AZURE_CERT_PROFILE",
}
INSTALLED_POLICY = ROOT / ".github/nightly-signing-policy.json"
DISPATCHER = ROOT / ".github/workflows/nightly-dispatch.yml"
@@ -259,8 +266,37 @@ class TrustedSourcePreparation(unittest.TestCase):
with self.subTest(workflow=name):
self.assertNotRegex(executable, r"(?im)^\s*(?:-\s*)?uses:\s*[^\n]*cache")
self.assertNotRegex(executable, r"(?im)^\s*[^\s:#]*cache[^\s:#]*:")
self.assertNotRegex(executable, r"(?im)^\s*(?:environment|secrets):")
self.assertNotIn("secrets.", executable)
# The producer caller forwards nothing. The signer caller declares the release
# environment and forwards exactly the fifteen secrets the sign steps read; those
# are the only allowed forms, and `inherit` is never one of them.
if name == "nightly.yml":
self.assertNotRegex(executable, r"(?im)^\s*(?:environment|secrets):")
self.assertNotIn("secrets.", executable)
else:
self.assertNotIn("secrets: inherit", executable)
# A job that calls a reusable workflow cannot declare an environment at all, so
# none may appear here.
self.assertNotRegex(executable, r"(?im)^\s*environment:")
# Parse the whole mapping: blank lines are legal inside a YAML block, so the
# block ends at the first non-blank line indented four spaces or less. Every
# entry must map a name to exactly its own secret, and the set must be exact.
lines = executable.splitlines()
start = lines.index(" secrets:") if " secrets:" in lines else -1
self.assertGreaterEqual(start, 0, "nightly-sign.yml must forward its named secrets")
entries = []
for line in lines[start + 1:]:
if not line.strip():
continue
if len(line) - len(line.lstrip()) <= 4:
break
entries.append(line.strip())
pairs = {}
for entry in entries:
match = re.fullmatch(r"([A-Z][A-Z0-9_]*): \$\{\{ secrets\.([A-Za-z0-9_]+) \}\}", entry)
self.assertIsNotNone(match, f"unexpected entry in the signer's secrets block: {entry}")
self.assertEqual(match.group(1), match.group(2), f"secret forwarded under another name: {entry}")
pairs[match.group(1)] = match.group(2)
self.assertEqual(set(pairs), SIGNER_SECRETS, "only the signer's named secrets may be forwarded")
def test_both_callers_use_one_shared_pin_in_uses_and_tooling_revision(self):
pins = set()