This repository was archived by the owner on Jul 16, 2026. It is now read-only.
Commit 6a59a88
authored
🪲 [Fix]: Resolve to the current version on non-PR events (workflow_dispatch, schedule) (#10)
On non–pull-request events (for example `workflow_dispatch` and
`schedule`), the action now resolves to the current published version
instead of throwing. This is the root-cause fix for the `Plan` failures
consumers see on scheduled and manual runs.
- Part of the fix for PSModule/Process-PSModule#373
## Fixed: no more throw on non–pull-request events
Previously the action required a `pull_request` payload and threw
`"...must be run from a pull_request event"` on any other event. Because
Process-PSModule's `Plan` job runs this on every event, that failed the
whole run on `schedule` / `workflow_dispatch` for every consumer.
Now, when the event has no `pull_request`, `Get-GitHubPullRequest`
returns `$null` and the caller resolves a no-op decision: no bump, no
prerelease, nothing published — so `Get-NextModuleVersion` returns the
**current published version** unchanged.
## New: non-PR runs report the current version
There are no PR labels on `workflow_dispatch` / `schedule`, so there's
nothing to bump from. The action keeps the latest published version
(GitHub Release / PS Gallery), which is what a scheduled or manual
re-test should build and test against. For a module that has never been
released this floors at `0.0.0`. Pull-request and
merge-to-default-branch behavior is unchanged — labels drive the bump,
with patch as the default.
## Technical Details
- `scripts/Resolve-PSModuleVersion.Helpers.psm1`:
`Get-GitHubPullRequest` returns `$null` on a non-PR event instead of
throwing.
- `scripts/main.ps1`: builds a no-op release decision (all flags
`false`, empty prerelease) when there is no pull request, otherwise
calls `Resolve-ReleaseDecision` as before. `Get-NextModuleVersion` then
returns `LatestVersion` unchanged.
- `tests/`: added cases asserting the no-op decision keeps the current
version (`1.2.3` and the `0.0.0` floor) with no bump and no prerelease.
Full suite: 159 passed, PSScriptAnalyzer clean.
- Follow-up: once released, Process-PSModule bumps its `Resolve-Version`
pin to this version, which lets its `Plan.yml` gate + `999.0.0` fallback
in PR #375 be dropped.1 parent 8d1dac7 commit 6a59a88
3 files changed
Lines changed: 97 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
130 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
131 | 133 | | |
132 | 134 | | |
133 | | - | |
| 135 | + | |
| 136 | + | |
134 | 137 | | |
135 | 138 | | |
136 | 139 | | |
| |||
149 | 152 | | |
150 | 153 | | |
151 | 154 | | |
152 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
153 | 158 | | |
154 | 159 | | |
155 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
13 | 30 | | |
14 | 31 | | |
15 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
0 commit comments