Switch PAT to GitHubApps#8616
Open
chidozieononiwu wants to merge 1 commit 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 Azure DevOps pipeline step templates to standardize GitHub authentication by switching from the legacy azuresdk-github-pat variable to a GitHub App–minted GH_TOKEN, and by adding a shared login-to-github.yml step to centralize token acquisition.
Changes:
- Replaced
$(azuresdk-github-pat)usage with$(GH_TOKEN)(or parameters defaulting to it) across multiple templates. - Added
/eng/common/pipelines/templates/steps/login-to-github.ymlahead of GitHub CLI / token-dependent actions, with explicitTokenOwnersin most templates. - Updated templates to make token ownership more explicit/traceable via
TokenOwners.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| eng/pipelines/templates/steps/update-prcomment.yml | Uses GH_TOKEN by default and adds a GitHub App login step with owner derived from Repo. |
| eng/pipelines/templates/steps/set-git-credentials.yml | Switches git credential token default to GH_TOKEN and adds a GitHub App login step. |
| eng/pipelines/templates/steps/publish-extension.yml | Adds GitHub App login step and replaces PAT usage with GH_TOKEN for gh operations. |
| eng/pipelines/templates/steps/publish-cli.yml | Adds GitHub App login step (conditional) and replaces PAT usage with GH_TOKEN for gh operations. |
| eng/pipelines/templates/steps/publish-cli-winget.yml | Switches default token to GH_TOKEN and adds GitHub App login step before WinGet submission. |
Comment on lines
+7
to
+11
| - template: /eng/common/pipelines/templates/steps/login-to-github.yml | ||
| parameters: | ||
| TokenOwners: | ||
| - ${{ parameters.Username }} | ||
|
|
JeffreyCA
approved these changes
Jun 11, 2026
vhvb1989
approved these changes
Jun 11, 2026
hemarina
approved these changes
Jun 12, 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.
This pull request updates several pipeline templates to standardize GitHub authentication and token usage. The main improvements are the switch from the
azuresdk-github-patvariable toGH_TOKENfor GitHub authentication, and the addition of a shared login step to ensure tokens are properly configured. These changes improve maintainability and security by centralizing authentication logic and making token ownership explicit.Authentication and Token Management Improvements:
Replaced usage of the
azuresdk-github-patvariable withGH_TOKENfor theGitHubTokenandGitHubPatparameters in multiple pipeline templates, includingpublish-cli.yml,publish-extension.yml,publish-cli-winget.yml,set-git-credentials.yml, andupdate-prcomment.yml. This ensures consistency and better aligns with current token management practices. [1] [2] [3] [4] [5] [6] [7] [8]Added the
/eng/common/pipelines/templates/steps/login-to-github.ymltemplate step to all relevant pipeline templates. This step ensures that GitHub authentication is properly established before any GitHub-related actions are performed. [1] [2] [3] [4] [5]Token Ownership Explicitness:
TokenOwnersbased on repository or username context, improving traceability and clarity of token usage in the pipeline. [1] [2] [3] [4]These changes collectively improve the security, clarity, and maintainability of the CI/CD pipeline authentication process.