Sync eng/common directory with azure-sdk-tools for PR 14219#45437
Merged
Sync eng/common directory with azure-sdk-tools for PR 14219#45437
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Syncs eng/common GitHub login tooling with azure-sdk-tools PR 14219 by extending the existing PowerShell token-minting script to work in GitHub Actions and adding a composite GitHub Action wrapper.
Changes:
- Update
eng/common/scripts/login-to-github.ps1to export tokens in GitHub Actions viaGITHUB_ENVand mask them. - Add
eng/common/actions/login-to-github/action.ymlcomposite action that wraps the PowerShell script for GitHub Actions usage.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| eng/common/scripts/login-to-github.ps1 | Adds GitHub Actions support (mask + export to GITHUB_ENV) and tweaks Key Vault signing error output. |
| eng/common/actions/login-to-github/action.yml | New composite action wrapper to call the script from GitHub Actions workflows. |
Comments suppressed due to low confidence (2)
eng/common/scripts/login-to-github.ps1:107
az keyvault key sign ... | ConvertFrom-Jsoncan throw before the$LASTEXITCODEcheck ifazoutputs non-JSON on failure (and with$ErrorActionPreference='Stop'this becomes a terminating error). This can also make the new error message unhelpful (e.g.,$SignResultJsonis unset/partial). Consider capturing the rawazoutput (stdout+stderr), checking$LASTEXITCODE, then parsing JSON only on success so failures reliably surface the real CLI error text.
--digest $Base64Value | ConvertFrom-Json
if ($LASTEXITCODE -ne 0) {
throw "Failed to sign JWT with Azure Key Vault. Error: $($SignResultJson | ConvertTo-Json -Compress)"
eng/common/actions/login-to-github/action.yml:43
- The “multiple owners” example uses
token-owners: Azure,azure-sdk,MicrosoftDocs, but the documented variable naming scheme (GH_TOKEN_<Owner>) would yieldGH_TOKEN_azure-sdk, which is not a valid env var name for GitHub Actions and can’t be referenced via${{ env.* }}. Update the example and/or documentation to reflect the sanitized variable name that will be exported (or restrict owners to names that produce valid env var identifiers).
# Usage (multiple owners):
# - uses: ./eng/common/actions/login-to-github
# with:
# token-owners: Azure,azure-sdk,MicrosoftDocs
#
weshaggard
approved these changes
Mar 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#14219 See eng/common workflow