Skip to content
Merged
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
12 changes: 6 additions & 6 deletions .github/workflows/release-winget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ jobs:
$env:TAG_NAME -match 'v(.*?)vfs\.(.*)'
$version = $Matches[1] + $Matches[2]

# Download the token from Azure Key Vault and mask it in the logs
$env:WINGET_CREATE_GITHUB_TOKEN = az keyvault secret show --name ${{ secrets.WINGET_TOKEN_SECRET_NAME }} --vault-name ${{ secrets.AZURE_VAULT }} --query "value" -o tsv
Write-Host -NoNewLine "::add-mask::$env:WINGET_CREATE_GITHUB_TOKEN"

# Download wingetcreate and create manifests
Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
.\wingetcreate.exe update Microsoft.Git `
Expand All @@ -72,14 +76,10 @@ jobs:
"$($asset_arm64_url)|arm64|machine" `
"$($asset_arm64_url)|arm64|user"

# Download the token from Azure Key Vault and mask it in the logs
Copy link
Member

Choose a reason for hiding this comment

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

There is no need whatsoever to change this comment.

Copy link
Author

Choose a reason for hiding this comment

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

Restored the original comment text in 1a84bae.

az keyvault secret download --name ${{ secrets.WINGET_TOKEN_SECRET_NAME }} --vault-name ${{ secrets.AZURE_VAULT }} --file token.txt
Write-Host -NoNewLine "::add-mask::$(Get-Content token.txt)"
Comment on lines -75 to -77
Copy link
Member

Choose a reason for hiding this comment

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

Aha! So my assumption when I wrote the issue description was incorrect: The secret is not obtained in a separate step. Therefore, it does not make sense to make it an output. So: don't. Rather, just set the correct environment variable instead of writing to a file..

Copy link
Author

Choose a reason for hiding this comment

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

Fixed in 528a3af - now the token is retrieved directly into $env:WINGET_CREATE_GITHUB_TOKEN within the same step, no outputs or separate steps.


# Submit the manifest to the winget-pkgs repository
$manifestDirectory = "$PWD\manifests\m\Microsoft\Git\$version"
$output = & .\wingetcreate.exe submit -t "$(Get-Content token.txt)" $manifestDirectory
$output = & .\wingetcreate.exe submit $manifestDirectory
Write-Host $output
$url = ($output | Select-String -Pattern 'https://\S+' | ForEach-Object { $_.Matches.Value })[0]
$url = ($output | Select-String -Pattern 'https://github\.com/microsoft/winget-pkgs/pull/\S+' | ForEach-Object { $_.Matches.Value })[0]
Write-Host "::notice::Submitted ${env:TAG_NAME} to winget as $url"
shell: powershell
Loading