Skip to content

v1.1.5

Latest

Choose a tag to compare

@github-actions github-actions released this 11 Jul 13:21
6a59a88

🪲 [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.

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.