[release/v7.5] Update metadata.json to update the Latest attribute with a better name by daxian-dbw · Pull Request #26826 · PowerShell/PowerShell · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pipelines/templates/channelSelection.yml
8 changes: 4 additions & 4 deletions .pipelines/templates/release-prep-for-ev2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ stages:
- template: release-SetReleaseTagandContainerName.yml
parameters:
restorePhase: true

- pwsh: |
$packageVersion = '$(OutputReleaseTag.ReleaseTag)'.ToLowerInvariant() -replace '^v',''
$vstsCommandString = "vso[task.setvariable variable=packageVersion]$packageVersion"
Expand All @@ -42,7 +42,7 @@ stages:
displayName: Set Package version
env:
ob_restore_phase: true

- pwsh: |
$branch = 'mirror-target'
$gitArgs = "clone",
Expand Down Expand Up @@ -151,7 +151,7 @@ stages:
$metadataHash = @{}
$skipPublishValue = '${{ parameters.skipPublish }}'
$metadataHash["ReleaseTag"] = '$(OutputReleaseTag.ReleaseTag)'
$metadataHash["LTS"] = $metadata.LTSRelease.Latest
$metadataHash["LTS"] = $metadata.LTSRelease.PublishToChannels
$metadataHash["ForProduction"] = $true
$metadataHash["SkipPublish"] = [System.Convert]::ToBoolean($skipPublishValue)

Expand Down Expand Up @@ -222,7 +222,7 @@ stages:
files_to_sign: '*.ps1'
search_root: '$(repoRoot)/.pipelines/EV2Specs/ServiceGroupRoot/Shell/Run'
displayName: Sign Run.ps1

- pwsh: |
# folder to tar must have: Run.ps1, settings.toml, python_dl
$srcPath = Join-Path '$(ev2ServiceGroupRootFolder)' -ChildPath 'Shell'
Expand Down
10 changes: 7 additions & 3 deletions .pipelines/templates/release-upload-buildinfo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
variables:
- name: NugetSecurityAnalysisWarningLevel
value: none
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
- name: DOTNET_NOLOGO
value: 1
- name: ob_outputDirectory
value: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT'
Expand All @@ -39,7 +39,7 @@ jobs:
- template: release-SetReleaseTagandContainerName.yml

- pwsh: |
Get-ChildItem Env:
Get-ChildItem Env: | Out-String -width 9999 -Stream | write-Verbose -Verbose
displayName: 'Capture Environment Variables'

- download: PSPackagesOfficial
Expand All @@ -58,6 +58,10 @@ jobs:
$metadata = Get-Content -LiteralPath "$toolsDirectory/metadata.json" -ErrorAction Stop | ConvertFrom-Json
$stableReleaseTag = $metadata.StableReleaseTag -Replace 'v',''

$currentReleaseTag = $buildInfo.ReleaseTag -Replace 'v',''
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line references $buildInfo before it's defined. The $buildInfo variable is not created until line 69, so this line will fail at runtime with an error about using an undefined variable. This line appears to be a duplicate of line 71 and should be removed.

Suggested change
$currentReleaseTag = $buildInfo.ReleaseTag -Replace 'v',''

Copilot uses AI. Check for mistakes.
$stableRelease = $metadata.StableRelease.PublishToChannels
$ltsRelease = $metadata.LTSRelease.PublishToChannels

Write-Verbose -Verbose "Writing $jsonFile contents:"
$buildInfoJsonContent = Get-Content $jsonFile -Encoding UTF8NoBom -Raw
Write-Verbose -Verbose $buildInfoJsonContent
Expand Down Expand Up @@ -142,4 +146,4 @@ jobs:
Write-Verbose -Verbose "Uploading $jsonFile to $containerName/$prefix/$blobName"
Set-AzStorageBlobContent -File $jsonFile -Container $containerName -Blob "$prefix/$blobName" -Context $storageContext -Force
}
condition: and(succeeded(), or(eq(variables['UploadPreview'], 'YES'), eq(variables['UploadLTS'], 'YES'), eq(variables['UploadStable'], 'YES')))
condition: and(succeeded(), or(eq(variables['UploadPreview'], 'YES'), eq(variables['UploadLTS'], 'YES'), eq(variables['UploadStable'], 'YES')))
10 changes: 5 additions & 5 deletions tools/metadata.json
Loading