11param (
22 [Parameter (Mandatory = $true )]
3- [string ]$PackageName ,
4-
5- [Parameter (Mandatory = $true )]
6- [string ]$PackageVersion ,
7-
8- [Parameter (Mandatory = $false )]
9- [int ]$MaxCount = 5
3+ [string ]$PackageInfoFilePath
104)
115
126<#
@@ -16,23 +10,31 @@ param(
1610. DESCRIPTION
1711 This script helps to mark release plan completion by finding the active release plans for a package name
1812
19- . PARAMETER PackageName
20- The package name being released (required)
21-
22- . PARAMETER PackageVersion
23- The package version being released (required)
24-
25- . PARAMETER MaxCount
26- Maximum number of recent pull request merges to check (default: 5)
27-
13+ . PARAMETER PackageInfoFilePath
14+ The path to the package information file (required)
2815#>
2916
3017Set-StrictMode - Version 3
3118. (Join-Path $PSScriptRoot common.ps1)
3219. (Join-Path $PSScriptRoot Helpers DevOps- WorkItem- Helpers.ps1)
3320
34- $AzureDevOpsOrganization = " azure-sdk"
35- $AzureDevOpsProject = " Release"
21+
22+ # Get package properties
23+ if (-Not (Test-Path $PackageInfoFilePath ))
24+ {
25+ Write-Host " Package information file path $ ( $PackageInfoFilePath ) is invalid."
26+ exit 0
27+ }
28+ # Get package info from json file created before updating version to daily dev
29+ $pkgInfo = Get-Content $PackageInfoFilePath | ConvertFrom-Json
30+ $PackageVersion = $pkgInfo.Version
31+ $PackageName = $pkgInfo.Name
32+ if (! $PackageName -or ! $PackageVersion )
33+ {
34+ Write-Host " Package name or version is not available in the package information file. Skipping the release plan status update for the package."
35+ exit 0
36+ }
37+
3638# Check Azure DevOps Release Plan work items if LanguageShort is available
3739Write-Host " Checking active release plan work items for package: $PackageName "
3840$workItems = Get-ReleasePlanForPackage $PackageName
0 commit comments