🪲 [Fix]: Plan no longer fails on schedule/workflow_dispatch (skip version resolution on non-PR events)#375
Open
Marius Storhaug (MariusStorhaug) wants to merge 2 commits into
Conversation
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
July 10, 2026 10:34
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a regression where the reusable workflow’s Plan job failed on non–pull-request events (e.g., schedule, workflow_dispatch) by ensuring version resolution only runs when PR context exists.
Changes:
- Gate the
Resolve-Versionstep to run only onpull_requestevents. - Add an in-file comment explaining the PR-context requirement and why skipping is safe for non-PR runs.
- Preserve downstream behavior by allowing
Enrich-Settingsto consume empty outputs and defaultReleaseType/CreateReleaseappropriately.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Copilot started reviewing on behalf of
Marius Storhaug (MariusStorhaug)
July 10, 2026 10:49
View session
Comment on lines
+89
to
+93
| # bump and the prerelease name). Skip it on non-PR events (schedule, workflow_dispatch, | ||
| # push): there ReleaseType is 'None', nothing is published, and Enrich-Settings falls | ||
| # back to safe empty defaults. Without this gate the action throws on non-PR events and | ||
| # fails the whole run. Fixes #373. | ||
| if: github.event_name == 'pull_request' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
Planjob no longer fails onschedule,workflow_dispatch, or other non–pull-request events, and those runs now complete their full build/test cycle green with no release. Releases and prereleases are unchanged.Fixed: non–pull-request runs (schedule / workflow_dispatch)
Since v6.1.0 (which moved version resolution into
Plan), two things broke non-PR runs:Resolve-Versionran on every event and threw"...must be run from a pull_request event", failingPlan(and therefore the whole run, since every jobneeds: Plan).Planwas fixed, the module-local tests failed with "Tests did not execute": theTest-ModuleLocalprescript imports the built module with-RequiredVersion '<Module.Version>', but on non-PR eventsModule.Versionis empty (no PR labels to resolve from), producing-RequiredVersion ''— a binding error that prevented the module from importing.Both are fixed:
Plan.yml:Resolve-Versionis gated topull_requestevents. On non-PR eventsReleaseTypeis alreadyNoneandRun.PublishModuleis alreadyfalse, andEnrich-Settingsfalls back to safe empty version defaults.Test-ModuleLocal.yml: the prescript's-RequiredVersionnow falls back to999.0.0whenModule.Versionis empty, matching the placeholderBuild-Modulealready uses. So on non-PR runs the module is built as999.0.0and imported as999.0.0— consistent, and tests execute.The release model is unchanged and matches the intended behavior:
schedule,workflow_dispatch).prereleaselabel → prerelease.Technical Details
.github/workflows/Plan.yml: addif: github.event_name == 'pull_request'to theResolve-Versionstep (with an explanatory comment). No change to the sharedResolve-PSModuleVersion/Get-PSModuleSettingsactions..github/workflows/Test-ModuleLocal.yml:-RequiredVersion '${{ ...Module.Version != '' && ...Module.Version || '999.0.0' }}', mirroring the fallback already inBuild-Module.yml.workflow_dispatchself-test run: completed successfully —Planpasses and allTest-ModuleLocaljobs (Test-Environment + Test-PSModuleTest, Linux/macOS/Windows) pass, with Publish skipped (no release). Previously this failed atPlan.pull_request):Resolve-Versionstill runs and succeeds — version resolution / release path intact.