Commit aeb7423
committed
ci: route the windows leg to a self-hosted runner on trusted events only
The windows leg dominates this matrix at 11.8min against ubuntu's 4.6min,
and #711/#653 were decided by runner variance rather than by the code under
review. A maintainer's own Windows box removes that, but it is a personal
machine on a home network: whatever runs on it runs as a local user with
that user's files and LAN in reach.
So the routing decision is made from the event, not from the workflow body.
`push` on dev/main/preview requires the push permission, which only the
MAINTAINERS.md set holds, and `workflow_dispatch` requires write access.
Those two go to the home box. `pull_request` never does.
An author check inside this file would not be equivalent. `ci.yml` runs from
the PR head on `pull_request`, so any `if: author_association == ...` guard
is deletable by the same patch it is meant to stop, as are the tsconfig,
lockfile and postinstall hooks the run would otherwise honour. Only a
decision made before a runner is chosen survives a hostile head.
Two supporting details. `matrix.include` carries a fixed `name` because a
label-array runner renders into the check name, so deriving it would rename
the required check depending on which machine served it. And the self-hosted
leg wipes its workspace first: a persistent working directory keeps files
that the commit under test deleted, which passes a suite against a tree that
no longer exists in git.
Routing is gated on the `OCX_SELF_HOSTED_WINDOWS` repository variable, which
is unset today, so every leg still resolves to windows-latest until the
runner is registered and the variable is flipped.1 parent 320814a commit aeb7423
1 file changed
Lines changed: 86 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
48 | 100 | | |
49 | | - | |
50 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
51 | 104 | | |
52 | 105 | | |
53 | 106 | | |
| |||
62 | 115 | | |
63 | 116 | | |
64 | 117 | | |
65 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
66 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
67 | 146 | | |
68 | 147 | | |
69 | 148 | | |
| |||
113 | 192 | | |
114 | 193 | | |
115 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
116 | 199 | | |
117 | 200 | | |
118 | 201 | | |
| |||
0 commit comments