Skip to content

🪲 [Fix]: Resolve the current version on non-PR runs (bump Resolve-PSModuleVersion to v1.1.5)#375

Merged
Marius Storhaug (MariusStorhaug) merged 2 commits into
mainfrom
fix/plan-resolve-version-non-pr-events
Jul 11, 2026
Merged

🪲 [Fix]: Resolve the current version on non-PR runs (bump Resolve-PSModuleVersion to v1.1.5)#375
Marius Storhaug (MariusStorhaug) merged 2 commits into
mainfrom
fix/plan-resolve-version-non-pr-events

Conversation

@MariusStorhaug

@MariusStorhaug Marius Storhaug (MariusStorhaug) commented Jul 10, 2026

Copy link
Copy Markdown
Member

The Plan job no longer fails on schedule and workflow_dispatch events. Resolve-PSModuleVersion is bumped to v1.1.5, which resolves the current published version on non–pull-request events instead of throwing.

Fixed: non–pull-request runs (schedule / workflow_dispatch)

Since v6.1.0 the Plan job runs Resolve-Version on every event, and the action threw "...must be run from a pull_request event" on non-PR events — failing the whole run (every job needs: Plan). Resolve-PSModuleVersion v1.1.5 (PSModule/Resolve-PSModuleVersion#10) fixes this at the source: on a non-PR event it returns the current published version — no bump, no prerelease, nothing published — floored at 0.0.0 for a module that has never been released. Pull-request and merge-to-default-branch behavior is unchanged: labels drive the bump (patch default), and the version preview on regular PRs is retained.

Technical Details

  • .github/workflows/Plan.yml: bump the Resolve-Version pin 8d1dac7 (v1.1.4) → 6a59a88 (v1.1.5). One-line change — no Plan gate or Test-ModuleLocal fallback is needed, because v1.1.5 always populates Settings.Module.Version on non-PR events.
  • This supersedes this PR's earlier Plan.yml gate + 999.0.0 fallback approach, replaced by the root-cause fix in the shared action.
  • Validated: a workflow_dispatch self-test run on this branch completes (previously failed at Plan); the PR self-test resolves a version as before.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-Version step to run only on pull_request events.
  • 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-Settings to consume empty outputs and default ReleaseType/CreateRelease appropriately.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Pass ✅
POWERSHELL Pass ✅
PRE_COMMIT Pass ✅
SPELL_CODESPELL Pass ✅
TRIVY Pass ✅
YAML Pass ✅

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/Plan.yml Outdated
@MariusStorhaug

Copy link
Copy Markdown
Member Author

Superseded by the root-cause fix in PSModule/Resolve-PSModuleVersion#10 — the action now resolves to the current version on non-PR events (workflow_dispatch/schedule) instead of throwing, per the agreed design (no bump label → current version; PR/merge keep patch-default). Once #10 is released, this PR will be reworked into a simple bump of the Resolve-Version pin, dropping the Plan.yml gate and the 999.0.0 fallback. Marking as draft until then.

@MariusStorhaug Marius Storhaug (MariusStorhaug) marked this pull request as draft July 11, 2026 11:38
@MariusStorhaug Marius Storhaug (MariusStorhaug) force-pushed the fix/plan-resolve-version-non-pr-events branch from 7a5a176 to 42ad0d6 Compare July 11, 2026 13:23
@MariusStorhaug Marius Storhaug (MariusStorhaug) changed the title 🪲 [Fix]: Plan no longer fails on schedule/workflow_dispatch (skip version resolution on non-PR events) 🪲 [Fix]: Resolve the current version on non-PR runs (bump Resolve-PSModuleVersion to v1.1.5) Jul 11, 2026
@MariusStorhaug Marius Storhaug (MariusStorhaug) marked this pull request as ready for review July 11, 2026 13:23
@MariusStorhaug

Copy link
Copy Markdown
Member Author

Reworked into the pin bump as planned now that PSModule/Resolve-PSModuleVersion#10 is merged and released as v1.1.5. The branch was reset to current main (v6.1.2) and now contains a single one-line change: Resolve-Version pin v1.1.4 -> v1.1.5. The earlier Plan.yml gate + 999.0.0 fallback are dropped — v1.1.5 always populates the version on non-PR events, so neither is needed. Marked ready for review.

Copilot AI review requested due to automatic review settings July 11, 2026 13:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 11, 2026 14:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@MariusStorhaug Marius Storhaug (MariusStorhaug) merged commit da180ba into main Jul 11, 2026
69 checks passed
@MariusStorhaug Marius Storhaug (MariusStorhaug) deleted the fix/plan-resolve-version-non-pr-events branch July 11, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plan job fails on schedule/workflow_dispatch: Resolve-Version requires a pull_request event (v6.1.0+ regression)

2 participants