Skip to content

Commit 2a7ba47

Browse files
Copilotdscho
andcommitted
fixup! Adding winget workflows
According to the winget-create documentation, for CI/CD scenarios it is recommended to use the WINGET_CREATE_GITHUB_TOKEN environment variable to pass the token to wingetcreate.exe rather than the -t command-line flag. The concern is that command-line arguments might be logged in process listings, whereas environment variables are more secure as they are not typically exposed in such listings. This is not so much a concern in our use case, because we diligently mask out the secret value from the logs. Co-authored-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent c9b40e1 commit 2a7ba47

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎.github/workflows/release-winget.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ jobs:
7373
"$($asset_arm64_url)|arm64|user"
7474
7575
# Download the token from Azure Key Vault and mask it in the logs
76-
az keyvault secret download --name ${{ secrets.WINGET_TOKEN_SECRET_NAME }} --vault-name ${{ secrets.AZURE_VAULT }} --file token.txt
77-
Write-Host -NoNewLine "::add-mask::$(Get-Content token.txt)"
76+
$env:WINGET_CREATE_GITHUB_TOKEN = az keyvault secret show --name ${{ secrets.WINGET_TOKEN_SECRET_NAME }} --vault-name ${{ secrets.AZURE_VAULT }} --query "value" -o tsv
77+
Write-Host -NoNewLine "::add-mask::$env:WINGET_CREATE_GITHUB_TOKEN"
7878
7979
# Submit the manifest to the winget-pkgs repository
8080
$manifestDirectory = "$PWD\manifests\m\Microsoft\Git\$version"
81-
$output = & .\wingetcreate.exe submit -t "$(Get-Content token.txt)" $manifestDirectory
81+
$output = & .\wingetcreate.exe submit $manifestDirectory
8282
Write-Host $output
8383
$url = ($output | Select-String -Pattern 'https://\S+' | ForEach-Object { $_.Matches.Value })[0]
8484
Write-Host "::notice::Submitted ${env:TAG_NAME} to winget as $url"

0 commit comments

Comments
 (0)