-
Notifications
You must be signed in to change notification settings - Fork 106
release-winget: use the token in a safer way, and report the correct winget-pkgs PR URL #843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 ` | ||
|
|
@@ -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 | ||
| 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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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..
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 528a3af - now the token is retrieved directly into |
||
|
|
||
| # 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 | ||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.