1- name : Get-Settings
1+ name : Plan
2+
3+ # The Plan job is the single decision point for the workflow.
4+ # It runs two steps:
5+ # 1. Get-PSModuleSettings - loads and resolves configuration
6+ # 2. Resolve-PSModuleVersion - calculates the next version from settings + PR labels
7+ # All downstream jobs consume the Settings JSON and the resolved version outputs from this job.
28
39on :
410 workflow_call :
4551
4652 outputs :
4753 Settings :
48- description : The complete settings object including test suites
49- value : ${{ jobs.Get-Settings.outputs.Settings }}
54+ description : The complete settings object including test suites.
55+ value : ${{ jobs.Plan.outputs.Settings }}
56+ ModuleVersion :
57+ description : The Major.Minor.Patch part of the next version.
58+ value : ${{ jobs.Plan.outputs.ModuleVersion }}
59+ ModulePrerelease :
60+ description : The prerelease tag, empty string when not a prerelease.
61+ value : ${{ jobs.Plan.outputs.ModulePrerelease }}
62+ ModuleFullVersion :
63+ description : The full version string including prefix and prerelease tag (for example v1.4.0).
64+ value : ${{ jobs.Plan.outputs.ModuleFullVersion }}
65+ ReleaseType :
66+ description : The release type - Release, Prerelease, or None.
67+ value : ${{ jobs.Plan.outputs.ReleaseType }}
68+ CreateRelease :
69+ description : ' true when a release/prerelease should actually be created.'
70+ value : ${{ jobs.Plan.outputs.CreateRelease }}
5071
5172permissions :
5273 contents : read # to checkout the repo
53- pull-requests : write # to add labels to PRs
74+ pull-requests : write # to add labels / comments to PRs
5475
5576jobs :
56- Get-Settings :
57- name : Get-Settings
77+ Plan :
78+ name : Plan
5879 runs-on : ubuntu-latest
5980 outputs :
6081 Settings : ${{ steps.Get-Settings.outputs.Settings }}
82+ ModuleVersion : ${{ steps.Resolve-Version.outputs.Version }}
83+ ModulePrerelease : ${{ steps.Resolve-Version.outputs.Prerelease }}
84+ ModuleFullVersion : ${{ steps.Resolve-Version.outputs.FullVersion }}
85+ ReleaseType : ${{ steps.Resolve-Version.outputs.ReleaseType }}
86+ CreateRelease : ${{ steps.Resolve-Version.outputs.CreateRelease }}
6187 steps :
6288 - name : Checkout Code
6389 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -76,3 +102,18 @@ jobs:
76102 Version : ${{ inputs.Version }}
77103 WorkingDirectory : ${{ inputs.WorkingDirectory }}
78104 ImportantFilePatterns : ${{ inputs.ImportantFilePatterns }}
105+
106+ - name : Resolve-Version
107+ # Resolve only when the workflow is going to create a release/prerelease.
108+ if : fromJson(steps.Get-Settings.outputs.Settings).Publish.Module.ReleaseType != 'None'
109+ uses : PSModule/Resolve-PSModuleVersion@main
110+ id : Resolve-Version
111+ env :
112+ GH_TOKEN : ${{ github.token }}
113+ with :
114+ Settings : ${{ steps.Get-Settings.outputs.Settings }}
115+ Debug : ${{ inputs.Debug }}
116+ Prerelease : ${{ inputs.Prerelease }}
117+ Verbose : ${{ inputs.Verbose }}
118+ Version : ${{ inputs.Version }}
119+ WorkingDirectory : ${{ inputs.WorkingDirectory }}
0 commit comments