Skip to content

Switch PAT to GitHub Apps#44257

Closed
chidozieononiwu wants to merge 2 commits into
mainfrom
pat-to-github-apps
Closed

Switch PAT to GitHub Apps#44257
chidozieononiwu wants to merge 2 commits into
mainfrom
pat-to-github-apps

Conversation

@chidozieononiwu

Copy link
Copy Markdown
Member

This pull request updates the Azure Pipelines archetype spec-gen SDK YAML template to improve GitHub authentication handling and standardize the use of authentication tokens. The main changes involve switching from the azuresdk-github-pat variable to GH_TOKEN for GitHub authentication and ensuring the login step is explicitly included where needed.

Authentication improvements:

  • Replaced all uses of the azuresdk-github-pat variable with GH_TOKEN for GitHub authentication in steps that require repository access or pull request creation. [1] [2]

Pipeline step updates:

  • Added the /eng/common/pipelines/templates/steps/login-to-github.yml template to relevant pipeline stages to ensure proper GitHub login when running in internal projects or when creating pull requests. [1] [2]

@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown

Next Steps to Merge

Next steps that must be taken to merge this PR:
  • ❌ The required check named Protected Files has failed. Refer to the check in the PR's 'Checks' tab for details on how to fix it and consult the aka.ms/ci-fix guide
  • ❌ The required check named SDK Validation Status has failed. Refer to the check in the PR's 'Checks' tab for details on how to fix it and consult the aka.ms/ci-fix guide


Comment generated by summarize-checks workflow run.

@chidozieononiwu chidozieononiwu force-pushed the pat-to-github-apps branch 2 times, most recently from 9f95764 to b2e8032 Compare June 27, 2026 00:50
@github-actions github-actions Bot added the TypeSpec Authored with TypeSpec label Jun 27, 2026
@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown

API Change Check

APIView identified API level changes in this PR and created the following API reviews

Language API Review for Package
Go sdk/contosowidgetmanager/azmanager
JavaScript @azure/contoso-widgetmanager
Java com.azure:azure-contoso-widgetmanager
C# Azure.Template.Contoso

Comment generated by After APIView workflow run.

@github-actions github-actions Bot added TypeSpec Authored with TypeSpec and removed TypeSpec Authored with TypeSpec labels Jun 27, 2026
Comment thread eng/pipelines/templates/stages/archetype-spec-gen-sdk.yml
Comment thread eng/pipelines/templates/stages/archetype-spec-gen-sdk.yml
@chidozieononiwu chidozieononiwu force-pushed the pat-to-github-apps branch 3 times, most recently from 577b376 to 65c3732 Compare June 30, 2026 02:41
- ${{ if and(eq(variables['System.TeamProject'], 'internal'), endsWith(variables['Build.Repository.Name'], '-pr')) }}:
- checkout: self
displayName: 'Sparse checkout eng/common/scripts for GitHub login'
path: s/_login_scripts

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer no custom path to avoid cleanup step.

displayName: "Validate and update SDK repository commitish"

- ${{ if and(eq(variables['System.TeamProject'], 'internal'), endsWith(variables['Build.Repository.Name'], '-pr')) }}:
- checkout: self

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checkout: none + check: self is undocumented usage. It might not work with agent update.

Write-Host "##vso[task.setvariable variable=ReleasePlanInfo]$releasePlanInfo"
Write-Host "Release Plan Info: $releasePlanInfo"

- template: /eng/common/pipelines/templates/steps/git-push-changes.yml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Token needs to be passed in.


- ${{ if and(eq(variables['System.TeamProject'], 'internal'), eq(parameters.CreatePullRequest, true), ne(variables['Build.Reason'], 'PullRequest')) }}:
- template: /eng/common/pipelines/templates/steps/login-to-github.yml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

script path would need to be specified.

@raych1 raych1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've created another one as replacement
#44291

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

TypeSpec Authored with TypeSpec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants