🪲 [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-GitHubPullRequestreturns$nullon a non-PR event instead of throwing.scripts/main.ps1: builds a no-op release decision (all flagsfalse, empty prerelease) when there is no pull request, otherwise callsResolve-ReleaseDecisionas before.Get-NextModuleVersionthen returnsLatestVersionunchanged.tests/: added cases asserting the no-op decision keeps the current version (1.2.3and the0.0.0floor) with no bump and no prerelease. Full suite: 159 passed, PSScriptAnalyzer clean.- Follow-up: once released, Process-PSModule bumps its
Resolve-Versionpin to this version, which lets itsPlan.ymlgate +999.0.0fallback in PR #375 be dropped.