Pat to GitHub apps two#8734
Open
chidozieononiwu wants to merge 3 commits into
Open
Conversation
🔗 Linked Issue RequiredThanks for the contribution! Please link a GitHub issue to this PR by adding |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Azure DevOps release/publish pipeline templates to switch GitHub CLI authentication from a stored PAT to a GitHub App installation token minted at runtime (via eng/common/scripts/login-to-github.ps1), aiming to standardize token handling across jobs and stages.
Changes:
- Adds
ExportAsOutputVariablesupport tologin-to-github.ps1and plumbs it through thelogin-to-github.ymlstep template. - Updates publishing stage templates to generate a GitHub token and pass it to PR-commenting and release-related steps.
- Replaces
$(azuresdk-github-pat)with$(GH_TOKEN)in the extension release step template.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| eng/common/scripts/login-to-github.ps1 | Adds output-variable support and more robust installation owner matching for GitHub App token minting. |
| eng/common/pipelines/templates/steps/login-to-github.yml | Plumbs ExportAsOutputVariable through to the PowerShell script. |
| eng/pipelines/templates/steps/publish-extension.yml | Switches GH_TOKEN env usage from PAT to $(GH_TOKEN) for gh calls. |
| eng/pipelines/templates/stages/vscode-publish-integration.yml | Adds a token-generation job and passes $(GH_TOKEN) into the PR comment step. |
| eng/pipelines/templates/stages/publish.yml | Adds token generation (currently in Publish_Brew) and passes $(GH_TOKEN) into the PR comment step. |
| eng/pipelines/templates/stages/publish-extension.yml | Adds a token-generation job and makes release publishing depend on it. |
| eng/pipelines/release-cli.yml | Contains a whitespace-only line change near the publish stage template inclusion. |
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.
This pull request introduces improvements to the GitHub authentication flow in the CI/CD pipeline, enhancing token generation, handling, and usage across various pipeline templates and scripts. The main changes add support for exporting the GitHub token as an output variable, improve robustness in handling installation owners, and update pipeline stages to use the new token flow.
Enhancements to GitHub Token Handling:
eng/common/scripts/login-to-github.ps1:ExportAsOutputVariableparameter to allow exporting the GitHub token as an Azure DevOps output variable for downstream jobs. [1] [2]InstallationTokenOwners, including normalization and more robust matching logic for GitHub App installations. [1] [2]Invoke-LoginToGitHuband ensured test runs are skipped.Get-PropertyValuefor safer property access.eng/common/pipelines/templates/steps/login-to-github.yml:ExportAsOutputVariableparameter and passed it through to the script. [1] [2]Pipeline Integration:
publish.yml,publish-extension.yml,vscode-publish-integration.yml) to:GH_TOKENto subsequent jobs and tasks instead of using the previousazuresdk-github-patvariable. [1] [2] [3] [4]Other Minor Changes:
These changes make the pipeline more secure, flexible, and maintainable by standardizing GitHub token usage and improving compatibility with Azure DevOps output variables.
Part of resolving Azure/azure-sdk-tools#9842
azure-dev - ext - microsoft.azd.demo - public