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
2 changes: 1 addition & 1 deletion scripts/winterm/generate-winget-manifests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[ValidatePattern('^https://github\.com/HelloThisWorld/winTerm/releases/download/v1\.0\.1/winTerm-1\.0\.1-x64\.msix$')]
[ValidatePattern('^https://github\.com/HelloThisWorld/winTerm/releases/download/v1\.0\.2/winTerm-1\.0\.2-x64\.msix$')]
[string]$InstallerUrl,

[Parameter(Mandatory)]
Expand Down
9 changes: 9 additions & 0 deletions scripts/winterm/test-release-workflow.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ try
{
$workflowPath = Join-Path $repositoryRoot '.github\workflows\release.yml'
$workflow = Get-Content -LiteralPath $workflowPath -Raw
$wingetGeneratorPath = Join-Path $repositoryRoot 'scripts\winterm\generate-winget-manifests.ps1'
$wingetGenerator = Get-Content -LiteralPath $wingetGeneratorPath -Raw

foreach ($required in @(
"push:",
Expand Down Expand Up @@ -67,6 +69,13 @@ try
throw 'Release workflow must not upload broad workspace globs.'
}

$expectedWinGetInstallerPattern = "^https://github\.com/HelloThisWorld/winTerm/releases/download/v1\.0\.2/winTerm-1\.0\.2-x64\.msix$"
if (-not $wingetGenerator.Contains("[ValidatePattern('$expectedWinGetInstallerPattern')]") -or
$wingetGenerator.Contains('/v1\.0\.1/winTerm-1\.0\.1-x64\.msix'))
{
throw 'WinGet manifest generation does not accept only the current v1.0.2 public installer URL.'
}

Write-Host 'PASS: stable release workflow security and publication boundaries.' -ForegroundColor Green
}
catch
Expand Down