🌟 [Major]: Module version resolution now available as a standalone action#1
Draft
Marius Storhaug (MariusStorhaug) wants to merge 6 commits into
Draft
🌟 [Major]: Module version resolution now available as a standalone action#1Marius Storhaug (MariusStorhaug) wants to merge 6 commits into
Marius Storhaug (MariusStorhaug) wants to merge 6 commits into
Conversation
This was referenced May 17, 2026
…dd PSAvoidUsingWriteHost exclusion; suppress publishModule unused-var warning
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.
Module version resolution is now available as a standalone action. Workflows can call it before building so the resolved version is stamped into the artifact at build time, making the bytes that are tested the bytes that ship.
New: Standalone
Resolve-PSModuleVersionactionThe action consumes the JSON
Settingsoutput fromPSModule/Get-PSModuleSettingsand emits:VersionMajor.Minor.Patchportion of the resolved version.PrereleaseFullVersionVersionPrefixand prerelease tag.ReleaseTypeRelease,Prerelease, orNonewhen no version bump label is present.CreateReleasetruewhen a release or prerelease should be created.Typical usage in the Plan job:
The action validates
Settings.Publish.Module.ReleaseType, appliesIgnoreLabelsoverrides, picks the bump type from PR labels (MajorLabels>MinorLabels>PatchLabels/AutoPatching), then computes the next version from the higher of the latest GitHub Release and the latest PowerShell Gallery version. For prereleases it appends the sanitized branch name, optionalDatePrereleaseFormattimestamp, and an incremental counter calculated from existing prereleases on the same baseline + branch.Technical Details
action.yml: composite action withSettings(required JSON),Name,WorkingDirectory,Debug,Verbose,Version,Prereleaseinputs. InstallsPSModule/Install-PSModuleHelpersandPSSemVerbefore running the script.scripts/main.ps1: ports the version-resolution logic that previously lived inPublish-PSModule/src/init.ps1. Reads configuration fromPSMODULE_RESOLVE_PSMODULEVERSION_INPUT_SettingsJSON instead of separate env vars. Emits outputs via$env:GITHUB_OUTPUT. Cleanup-tag discovery stays inPublish-PSModule/cleanup.ps1and is intentionally out of scope here..github/workflows/Action-Test.yml: added 6 test jobs covering patch, minor, major, auto-patch, ignore-label, and None scenarios using a fake PR event override.Related PRs:
Version/Prereleaseinputs and stamps them into the manifest.