Skip to content

Commit

Permalink
check pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
freddydk committed Dec 6, 2023
1 parent 3148600 commit 2c41425
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Tests/TestActionsHelper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -191,17 +191,21 @@ function TestActionsReferences {

$actionReferences = [regex]::matches($yaml, $actionReferencePattern)

$alGoActionPattern = "^microsoft/AL-Go-Actions/*"
$alGoAction1Pattern = "^microsoft/AL-Go-Actions/*"
$alGoAction2Pattern = "^microsoft/AL-Go/Actions/*"
$gitHubActionPattern = "^actions/*"

$actionReferences | ForEach-Object {
$origin = $_.Groups[1].Value
$version = $_.Groups[2].Value

$origin | Should -Match "($alGoActionPattern|$gitHubActionPattern)"
$origin | Should -Match "($alGoAction1Pattern|$alGoAction2Pattern|$gitHubActionPattern)"

if($origin -match $alGoActionPattern) {
$version | Should -Match "main|preview"
if($origin -match $alGoAction1Pattern) {
$version | Should -Match "main"
}
if($origin -match $alGoAction2Pattern) {
$version | Should -Match "main"
}
}
}
Expand Down

0 comments on commit 2c41425

Please sign in to comment.