Skip to content

Commit

Permalink
version number check
Browse files Browse the repository at this point in the history
  • Loading branch information
srozemuller committed Jun 14, 2024
1 parent eb8e2e8 commit 35c636a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Compiler/Az.Avd.publishPSgallery.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ param (
[string]$PS_GALLERY_KEY
)
$env:ProjectName = "Az.Avd"
if ($env:GITHUB_REF_NAME -eq 'main') {
$regexPattern = '^\d+\.\d+\.\d+$'
if ($env:GITHUB_REF_NAME -match $regexPattern) {
try {
Publish-Module -Path (Join-Path ".././AzAvd" -ChildPath $env:ProjectName) -NuGetApiKey $PS_GALLERY_KEY
write-host "Module $env:ProjectName published"
Expand All @@ -14,5 +15,5 @@ if ($env:GITHUB_REF_NAME -eq 'main') {
}
}
else {
"Github branch is not main"
"Github $env:GITHUB_REF_NAME does not match a valid version number."
}

0 comments on commit 35c636a

Please sign in to comment.