Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

✨ [Minor]: Add Version and Prerelease inputs (PSModule/Process-PSModule#326)#135

Closed
Marius Storhaug (MariusStorhaug) wants to merge 1 commit into
mainPSModule/Build-PSModule:mainfrom
feat/326-resolve-psmodule-versionPSModule/Build-PSModule:feat/326-resolve-psmodule-versionCopy head branch name to clipboard
Closed

✨ [Minor]: Add Version and Prerelease inputs (PSModule/Process-PSModule#326)#135
Marius Storhaug (MariusStorhaug) wants to merge 1 commit into
mainPSModule/Build-PSModule:mainfrom
feat/326-resolve-psmodule-versionPSModule/Build-PSModule:feat/326-resolve-psmodule-versionCopy head branch name to clipboard

Conversation

@MariusStorhaug

Copy link
Copy Markdown
Member

Companion to PSModule/Process-PSModule#339 (PSModule/Process-PSModule#326).

Why

Publish-PSModule used to inject the final version into the module manifest after the build/test stages, which
meant the tested artifact was not the artifact that shipped. To enable Process-PSModule to compute the version up
front (in the new Plan job) and pass it through, Build-PSModule needs to accept the version as input and stamp
the manifest at build time.

What

  • Adds two optional inputs: Version (Major.Minor.Patch) and Prerelease.
  • When Version is omitted, the existing local-build behaviour is preserved — the manifest is stamped with the
    placeholder 999.0.0.
  • Prerelease, when set, is written to PrivateData.PSData.Prerelease so downstream tooling sees the full
    prerelease label without any additional steps.
  • README updated.

Backwards-compatible: existing callers that don't pass Version/Prerelease continue to behave 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

Adds optional Version and Prerelease inputs to the Build-PSModule action so the version/prerelease label can be stamped into the module manifest at build time (instead of being injected later by Publish-PSModule), ensuring the tested artifact is the one that ships. When Version is omitted, the existing 999.0.0 placeholder is preserved for local builds. This pairs with the v3.x rewrite of Process-PSModule and Publish-PSModule (issue #326).

Changes:

  • New Version and Prerelease action inputs wired through action.ymlmain.ps1Build-PSModuleBuild-PSModuleManifest.
  • Build-PSModuleManifest now stamps ModuleVersion and (when set) Prerelease directly on the manifest hashtable; the old in-line 999.0.0 literal and the post-build prerelease comment are removed/updated.
  • README expanded with a "What's new", Inputs and Outputs section.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
action.yml Declares the new optional Version and Prerelease inputs and forwards them as PSMODULE_BUILD_PSMODULE_INPUT_* env vars.
src/main.ps1 Reads the new env vars, coalesces empty Version to 999.0.0, logs them, and passes them to Build-PSModule.
src/helpers/Build-PSModule.ps1 Adds matching ModuleVersion / Prerelease parameters and forwards them to Build-PSModuleManifest.
src/helpers/Build/Build-PSModuleManifest.ps1 Accepts ModuleVersion / Prerelease, stamps them on the manifest (replacing the hard-coded 999.0.0 and removing the post-publish prerelease comment).
README.md Adds project description, "What's new" note about the new inputs, and Inputs/Outputs tables.

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

Comment thread README.md
Comment on lines +27 to +31
## Outputs

| Name | Description |
| ------------------------ | ---------------------------------------- |
| `ModuleOutputFolderPath` | Local path to the built module folder. |
Comment on lines +66 to +68
if ([string]::IsNullOrWhiteSpace($ModuleVersion)) {
$ModuleVersion = '999.0.0'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.