Repository navigation
[release/9.0] Enable OneLoc GitHub App authentication by default - #17262
Conversation
Co-authored-by: Copilot <[email protected]> Copilot-Session: a2aa4598-efc5-44f4-a67b-7db19982252d Copilot-Session: f12710df-91d5-49e4-b327-337932478b0b
Use the centralized dnceng GitHub App path by default for internal GitHub OneLoc builds while preserving explicit opt-out to the PAT path. Document that runtime App failures do not automatically fall back to the PAT. Co-authored-by: Copilot <[email protected]> Copilot-Session: 8d5c9824-be94-4260-a72c-605d0ce1294d
There was a problem hiding this comment.
Pull request overview
This PR backports the OneLocBuild GitHub App authentication work to release/9.0, introducing an Azure Key Vault–signed GitHub App installation-token flow and enabling it by default for dnceng/internal GitHub OneLoc builds while preserving an explicit PAT opt-out.
Changes:
- Adds
Get-GitHubAppToken.ps1plus pipeline step templates to mint a GitHub App installation token (ghs_*) via Key Vault signing. - Updates
onelocbuild.ymlto use the App token by default forRepoType: gitHubin theinternalAzure DevOps project, withUseGitHubAppAuthentication: falseas the opt-out. - Adds/updates documentation describing access requirements and clarifying there is no automatic PAT fallback if App auth fails.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| eng/common/templates/steps/get-github-app-token.yml | Adds non-1ES shim entry point for the new core step template. |
| eng/common/templates-official/steps/get-github-app-token.yml | Adds 1ES shim entry point for the new core step template. |
| eng/common/Get-GitHubAppToken.ps1 | Implements JWT signing via Key Vault and GitHub installation token minting. |
| eng/common/core-templates/steps/get-github-app-token.yml | Introduces the AzureCLI step template wrapper for token minting. |
| eng/common/core-templates/job/onelocbuild.yml | Enables and wires the App-token path by default for dnceng/internal GitHub builds. |
| Documentation/OneLocBuildGitHubApp.md | Adds detailed guidance for enabling/using the GitHub App auth path. |
| Documentation/OneLocBuild.md | Documents the new GitHub App auth option and surfaces the new parameters. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address review feedback by reading the Key Vault signature deterministically, paginating installation lookup, preserving 1ES template context, and clarifying installation token scope. Co-authored-by: Copilot <[email protected]> Copilot-Session: cf5c9dac-de56-477f-9858-541b9fec0178
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
Suppressed comments (1)
eng/common/Get-GitHubAppToken.ps1:145
- When
-OutputVariableNameis not provided, the script prints the installation token to the log (Write-Host $tokenResponse.token). If this script is ever invoked from an Azure DevOps pipeline without-OutputVariableName, it will leak a liveghs_token into build logs. Consider failing fast in CI whenOutputVariableNameis missing, and only allowing stdout output for local/manual runs.
}
else {
Write-Host $tokenResponse.token -ForegroundColor Green
}
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
Suppressed comments (2)
eng/common/Get-GitHubAppToken.ps1:142
- Even with the template currently passing
-OutputVariableName, the fallbackelse { Write-Host $tokenResponse.token }will log the fullghs_token if the script is ever invoked without it. OnceOutputVariableNameis mandatory/validated, this branch can be removed so the token is never written to logs.
if ($OutputVariableName) {
Write-Host "Setting pipeline variable '$OutputVariableName'."
Write-Host "##vso[task.setvariable variable=$OutputVariableName;issecret=true]$($tokenResponse.token)"
}
eng/common/Get-GitHubAppToken.ps1:40
OutputVariableNameis optional and the script prints the full installation token to stdout when it’s not provided. That creates an easy foot-gun where a secretghs_token can end up in build logs if the script is invoked without-OutputVariableName(or if an empty/whitespace name is passed). Since the template always uses a secret pipeline variable, makeOutputVariableNamemandatory and validate it’s non-empty.
This issue also appears on line 139 of the same file.
# Optional Azure DevOps pipeline variable name to set with the installation
# token (marked as a secret). When not specified, the token is written to
# stdout instead.
[Parameter(Mandatory = $false)]
[string] $OutputVariableName
akoeplinger
left a comment
There was a problem hiding this comment.
Is anyone even using OneLoc with 9.0 arcade? usually OneLoc only runs on main builds
Backport of #17219 and #17258 to
release/9.0.dnceng/internalGitHub builds.UseGitHubAppAuthentication: falseas the temporary PAT opt-out.Conflict resolution preserved the release branch's existing CEINTL documentation URLs.