🚀 [Feature]: Plan job decides version before build so tested artifact equals published artifact - #342
Conversation
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
The reusable workflow declared the gallery secret as APIKEY while every usage, the nested Publish-Module workflow, the test callers, and the README use APIKey. GitHub secret names are case-insensitive so publishing worked, but this removes the inconsistency Copilot flagged.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
.github/workflows/workflow.yml:8
- The workflow_call secret is renamed to
APIKEY, but downstream still referencessecrets.APIKey(e.g. Publish-Module job). This will fail at runtime (secrets.APIKeywill be empty/undefined) and also breaks the stated “public input/output contract … unchanged”. Keep the secret name asAPIKey(existing contract) or update all references consistently.
workflow_call:
secrets:
APIKey:
description: The API key for the PowerShell Gallery.
required: true
Module documentation now renders a command group's overview page as that group's **section landing page** — the content shown when the group is selected in the navigation — instead of a separate page nested under it. This is delivered by bumping the `Document-PSModule` action, and the behavior is documented in the repository and module-source structure guidance. - Fixes #371 ## Changed: Group overview pages are the section landing page Bumped `PSModule/Document-PSModule` to v1.0.18 in `Build-Docs.yml`. v1.0.18 publishes a group's overview page as the section index (`/Functions/<Group>/`) rather than a page nested under the group. Authors can name the overview after its folder (`<Category>/<Category>.md`) or provide `<Category>/index.md` directly; either becomes the section landing page. ## Changed: Documentation Documented the behavior in `README.md`: added a bullet under the repository expectations and updated the `Category.md` annotation in the module source-structure tree. ## Technical Details - `.github/workflows/Build-Docs.yml`: `Document-PSModule@fb5d349 # v1.0.17` -> `@349090c # v1.0.18`. - `main` already carries v1.0.17 (install built modules at their real version) from #342; this PR advances the pin to v1.0.18, which delivers the section-index behavior. - The site config already enables `navigation.indexes`, so no `mkdocs.yml` change is required.
The version a module ships with is now decided in a new
Planjob that runs before the module is built. The same artifact then flows through tests and publish without being mutated, so the artifact you tested is the artifact that lands in the PowerShell Gallery and on the GitHub Release.New: Plan job replaces Get-Settings
Get-Settings.ymlis renamed toPlan.yml. The Plan job runs two steps in sequence and exposes everything downstream jobs need:Get-PSModuleSettings— loads.github/PSModule.ymland emits the resolvedSettingsJSON.Resolve-PSModuleVersion— reads settings + PR labels, queries existing releases and the PowerShell Gallery, and emits the next version.Plan job output: a single
SettingsJSON. The resolved version is merged into it asSettings.Module.{Version, Prerelease, FullVersion, ReleaseType, CreateRelease}, so every downstream job receives one self-contained object with no separate version outputs.Changed: Build-Module now stamps the real version
Build-Module.ymlreads the version fromSettings.Module.Version/Settings.Module.Prereleaseand passes them toBuild-PSModule. The built manifest contains the version the module will ship with before any test runs. The999.0.0placeholder only appears when no version is provided (for example, direct callers that bypass the Plan job).Changed: Publish-Module no longer calculates or mutates versions
Publish-Module.ymldrops every input that used to drive version calculation:AutoPatchingDatePrereleaseFormatIgnoreLabelsIncrementalPrereleaseMajorLabels/MinorLabels/PatchLabelsReleaseTypeVersionPrefixPublish-Modulenow reads the version straight from the manifest that arrived fromBuild-Moduleand pushes it to the PowerShell Gallery as-is. The PR-title / PR-body / heading inputs are unchanged. The job also gains permission to upload release assets so the zipped module can be attached to the GitHub Release.Fixed: Tested artifact equals published artifact
The placeholder-then-rewrite flow is gone. The bytes tested in
Test-Module/Test-ModuleLocalare the same bytes published to the PowerShell Gallery and attached to the GitHub Release.Technical Details
Plan.yml(renamed fromGet-Settings.yml): adds aResolve-Versionstep (runs unconditionally — it computes the release decision, includingReleaseType) followed by anEnrich-Settingsstep that merges the resolved version intoSettings.Module.*. Plan exposes a singleSettingsoutput on both the job andworkflow_call.workflow.yml: theGet-Settingsjob is renamed toPlanand every downstreamneeds:/with:reference is repointed. Downstream jobs consume the singleneeds.Plan.outputs.Settingsobject (version available underSettings.Module.*).Build-Module.yml: readsSettings.Module.Version/Settings.Module.Prereleaseand passes them asVersion/PrereleasetoBuild-PSModule, falling back to the999.0.0placeholder when a direct caller bypasses Plan and omitsSettings.Module.Publish-Module.yml: removes the seven version-calculation inputs and grantscontents: writepermission for release-asset uploads.README.md: replaces theGet-Settingssection with aPlansection that documents both steps and the artifact-integrity guarantee, and notes the new release-asset upload.PSModule/Build-PSModulepinned to@v5.0.0(SHA672aaa7a91a379c4c6cd14494d03ab5e87e13c52).PSModule/Publish-PSModulepinned to@v3.0.0(SHA03c0f8b53d0367c85a0f121f98af9b40c817b0e3).Companion repos
PSModule/Resolve-PSModuleVersionPSModule/Build-PSModuleVersion/Prereleaseinputs — v5.0.0 releasedPSModule/Publish-PSModuleImplementation plan progress
Get-Settingsjob toPlanand addResolve-PSModuleVersionstepSettingsoutput (resolved version merged intoSettings.Module.{Version, Prerelease, FullVersion, ReleaseType, CreateRelease})Build-Module.ymlto read the version fromSettings.Module.*and stamp itPublish-Module.ymlneeds/withwiring acrossworkflow.ymlREADME.md(Plan section + release-asset note)Resolve-PSModuleVersionaction implementation (v1.1.0 released)Build-PSModuleVersion/Prereleaseinputs (v5.0.0 released)Publish-PSModulev3 release (v3.0.0 released — PSModule/Publish-PSModule#71)@mainreferences inBuild-Module.ymlandPublish-Module.ymlto released SHAsNotes
workflow.ymlis unchanged for external consumers — this is internal wiring.main.