Commit 52db79b
fix(ci): clear residual workflow startup_failures (secrets-in-if, hashFiles-in-job-if) (#363)
## What
Fixes the workflow **`startup_failure`** classes that fail *before any
job runs* and were **left on `main` after #360/#361**. Rebased onto
current `main` (`bec6161`); now scoped to exactly the two remaining root
causes.
## Why this is still needed after #360 / #361
#360 added `timeout-minutes` + fixed changelog YAML; #361 added more
`timeout-minutes` + fixed two malformed workflows. Neither addressed the
two `startup_failure` causes below — I re-verified both are still
present on `bec6161`. (Where they overlapped, the upstream fixes are
kept: `changelog-reusable.yml` and `boj-build.yml`'s malformed YAML are
already fixed upstream, so they drop out of this PR.)
## Fixes
### 1. `secrets` context in `if:` → *"Unrecognized named-value:
'secrets'"* (parse-time startup failure)
| File | Before | Fix |
|---|---|---|
| `boj-build.yml` | job-level `if: …secrets.BOJ_SERVER_URL…` | **Drop
the job `if`** — the Trigger step already self-gates (exits 0 on empty
`BOJ_URL`), so the job is a cheap no-op when unconfigured. |
| `instant-sync.yml` | step `if: secrets.FARM_DISPATCH_TOKEN …` (×2) |
Map secret → job-level `env`, gate steps on `env.FARM_DISPATCH_TOKEN`. |
| `mirror-reusable.yml` (`mirror-radicle`) | step `if:
secrets.RADICLE_KEY …` (×4) | Map secret → job-level `env`, gate steps
on `env.RADICLE_KEY`. |
`env` **is** available in step `if:` and secrets **are** valid in
job-level `env` — this is the canonical presence-gate pattern and is
correct whether or not `secrets`-in-`if` parses, so it can't regress a
working file.
### 2. `hashFiles()` in a **job-level** `if:` (always `''` → job
silently skipped on every repo)
Job `if:` is evaluated server-side **before checkout**, so
`hashFiles(...)` sees an empty workspace and returns `''` — meaning
`rust-ci`/`elixir-ci` skipped on **every** consumer, Rust/Elixir or not.
- `rust-ci-reusable.yml` (×4) and `elixir-ci-reusable.yml` (×1): add a
small **`detect`** job that checks out and exports a real boolean
(`has_cargo` / `has_mix`); the real jobs gate on
`needs.detect.outputs.*`. Behaviour preserved; the guard actually works
now. (Step-level `with: hashFiles(mix.lock)` for caching is untouched —
that runs on the runner and is fine.)
## Verification
- All 5 files parse as YAML.
- `git grep 'if:.*secrets\.'` over all workflows → **none**.
- `git grep 'if:.*hashFiles'` over all workflows → **none** (step-level
`with:` usages remain, correctly).
## Known Hypatia scan findings (no action — see below)
The non-blocking Hypatia scan reports
`secret_action_without_presence_gate` on:
- **`instant-sync.yml` · `peter-evans/repository-dispatch` (high)** —
**false-positive introduced by this PR's correct fix.** The rule
pattern-matches a literal `secrets.X != ''` gate on the step; I replaced
it with `env.FARM_DISPATCH_TOKEN != ''` precisely because
`secrets`-in-`if` is the `startup_failure` being fixed. The presence
gate genuinely still exists (env mapped from the secret) — Hypatia just
doesn't recognise the env-indirection. Satisfying the rule would mean
reintroducing the real startup failure, so **GitHub correctness wins**.
The proper root fix is to teach Hypatia's
`secret_action_without_presence_gate` rule to accept an
`env`-mapped-from-`secret` gate (separate change in the `hypatia` repo).
- **`mirror-reusable.yml` · `webfactory/ssh-agent` (high, ×2)** —
pre-existing (GITEA key), unrelated to this PR; a hygiene flag, not a
`startup_failure`.
## Registry-verify on this PR
The `Registry + topology in sync` check is red here, but **not because
of this PR** — these five edits are all top-level `.github/workflows/*`
files (no spec home), adding zero registry drift. It's the
**pre-existing `main` drift that #366 fixes** (inherited because this
branched off `main`). Once #366 lands, a rebase clears it. Deliberately
not regenerating the registry here, to avoid colliding with #366.
Consumers pin the reusables by SHA, so callers are unaffected until they
bump their pin.
https://claude.ai/code/session_0178nMYCNXgotTeekePkoUjd
Co-authored-by: Claude <noreply@anthropic.com>1 parent 6022e49 commit 52db79b
5 files changed
Lines changed: 92 additions & 17 deletions
File tree
- .github/workflows
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
101 | 130 | | |
102 | 131 | | |
103 | 132 | | |
104 | 133 | | |
105 | | - | |
106 | | - | |
| 134 | + | |
| 135 | + | |
107 | 136 | | |
108 | 137 | | |
109 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
18 | 24 | | |
19 | 25 | | |
20 | 26 | | |
| |||
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
27 | | - | |
| 33 | + | |
28 | 34 | | |
29 | 35 | | |
30 | 36 | | |
| |||
39 | 45 | | |
40 | 46 | | |
41 | 47 | | |
42 | | - | |
| 48 | + | |
43 | 49 | | |
44 | 50 | | |
45 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
162 | 168 | | |
163 | 169 | | |
164 | 170 | | |
| |||
174 | 180 | | |
175 | 181 | | |
176 | 182 | | |
177 | | - | |
| 183 | + | |
178 | 184 | | |
179 | 185 | | |
180 | 186 | | |
181 | 187 | | |
182 | | - | |
| 188 | + | |
183 | 189 | | |
184 | 190 | | |
185 | 191 | | |
186 | 192 | | |
187 | | - | |
| 193 | + | |
188 | 194 | | |
189 | 195 | | |
190 | 196 | | |
191 | 197 | | |
192 | 198 | | |
193 | 199 | | |
194 | | - | |
| 200 | + | |
195 | 201 | | |
196 | 202 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
105 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
106 | 133 | | |
107 | 134 | | |
108 | 135 | | |
109 | 136 | | |
110 | | - | |
| 137 | + | |
| 138 | + | |
111 | 139 | | |
112 | 140 | | |
113 | 141 | | |
| |||
147 | 175 | | |
148 | 176 | | |
149 | 177 | | |
150 | | - | |
151 | | - | |
| 178 | + | |
| 179 | + | |
152 | 180 | | |
153 | 181 | | |
154 | 182 | | |
| |||
187 | 215 | | |
188 | 216 | | |
189 | 217 | | |
190 | | - | |
| 218 | + | |
| 219 | + | |
191 | 220 | | |
192 | 221 | | |
193 | 222 | | |
| |||
216 | 245 | | |
217 | 246 | | |
218 | 247 | | |
219 | | - | |
| 248 | + | |
| 249 | + | |
220 | 250 | | |
221 | 251 | | |
222 | 252 | | |
| |||
0 commit comments