Open Gordonby opened 1 year ago
@Gordonby Thanks for reporting the issue. Sorry for the delay in response.
The reason is that the PSRule requires
option follows SemVer in a similar behaviour as NPM. A version major.minor.patch constraint won't automatically accept a pre-release version.
There are two approaches you could consider for setting a requires
constraint to allow pre-releases:
@prerelease
or just @pre
in the version constraint, which allows any pre-releases newer then 0.3.0
. e.g. @pre >=0.3.0
.
0.3.0
. >=0.3.0 || >=0.4.0-0
.
0.4.0-0
allows any stable version higher or equal to 0.4.0 and pre-releases of 0.4.0 only.From your question, you probably intend option 1.
The requires
option supports the same as the version
assertion. Which shows detailed examples of constraint options here: https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Assert/#version
Description of the issue
Specifying the prerelease flag on the CAF rules results in a version error.
To Reproduce
Ref: https://github.com/Azure/AKS-Construction/actions/runs/4054300944/workflow
Error output