@@ -7,6 +7,32 @@ Set-StrictMode -Version 3
7
7
8
8
. (Join-Path $PSScriptRoot common.ps1)
9
9
10
+ function ShouldVerifyChangeLog ($ServiceDirectory , $PackageName ) {
11
+ $jsonCiYmlPath = Join-Path $ServiceDirectory " ci.yml"
12
+
13
+ if (Test-Path $jsonCiYmlPath )
14
+ {
15
+ $ciYml = Get-Content $jsonCiYmlPath - Raw | yq - o= json | ConvertFrom-Json - AsHashTable
16
+
17
+ if ($ciYml.extends -and $ciYml.extends.parameters -and $ciYml.extends.parameters.Artifacts ) {
18
+ $packagesCheckingChangeLog = $ciYml.extends.parameters.Artifacts `
19
+ | Where-Object { -not ($_ [" skipVerifyChangelog" ] -eq $true ) } `
20
+ | Select-Object - ExpandProperty name
21
+ if ($packagesCheckingChangeLog -contains $PackageName )
22
+ {
23
+ return $true
24
+ } else {
25
+ return $false
26
+ }
27
+ }
28
+ }
29
+ }
30
+
31
+ if (-not (Get-Command ' yq' - ErrorAction SilentlyContinue)) {
32
+ Write-Host " Error: 'yq' is not installed or not found in PATH. Please remedy this before running this script."
33
+ exit 1
34
+ }
35
+
10
36
# find which packages we need to confirm the changelog for
11
37
$packageProperties = Get-ChildItem - Recurse " $PackagePropertiesFolder " * .json
12
38
@@ -15,14 +41,18 @@ $allPassing = $true
15
41
foreach ($propertiesFile in $packageProperties ) {
16
42
$PackageProp = Get-Content - Path $propertiesFile | ConvertFrom-Json
17
43
44
+ if (-not (ShouldVerifyChangeLog - ServiceDirectory (Join-Path $RepoRoot " sdk" $PackageProp.ServiceDirectory ) - PackageName $PackageProp.Name )) {
45
+ Write-Host " Skipping changelog verification for $ ( $PackageProp.Name ) "
46
+ continue
47
+ }
48
+
18
49
$validChangeLog = Confirm-ChangeLogEntry - ChangeLogLocation $PackageProp.ChangeLogPath - VersionString $PackageProp.Version - ForRelease $false
19
50
20
51
if (-not $validChangeLog ) {
21
52
$allPassing = $false
22
53
}
23
54
}
24
55
25
-
26
56
if (! $allPassing )
27
57
{
28
58
exit 1
0 commit comments