-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Switch PAT to GitHub Apps #44257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch PAT to GitHub Apps #44257
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| parameters: | ||
| - name: SpecRepoUrl | ||
| type: string | ||
|
|
@@ -178,6 +178,25 @@ | |
| Write-Host "Will use commitish for SDK repo checkout: '$checkoutCommitish'" | ||
| displayName: "Validate and update SDK repository commitish" | ||
|
|
||
| - ${{ if and(eq(variables['System.TeamProject'], 'internal'), endsWith(variables['Build.Repository.Name'], '-pr')) }}: | ||
| - checkout: self | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| displayName: 'Sparse checkout eng/common/scripts for GitHub login' | ||
| path: s/_login_scripts | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd prefer no custom path to avoid cleanup step. |
||
| sparseCheckoutDirectories: eng/common/scripts | ||
| fetchDepth: 1 | ||
|
|
||
| - pwsh: | | ||
| $source = "$(Build.SourcesDirectory)/_login_scripts/eng" | ||
| $dest = "$(Agent.TempDirectory)" | ||
| Copy-Item -Recurse -Force $source $dest | ||
| Remove-Item -Recurse -Force "$(Build.SourcesDirectory)/*" -ErrorAction SilentlyContinue | ||
| Remove-Item -Recurse -Force "$(Build.SourcesDirectory)/.git" -ErrorAction SilentlyContinue | ||
| displayName: Copy and clean repo checkout folder | ||
|
|
||
| - template: /eng/common/pipelines/templates/steps/login-to-github.yml | ||
| parameters: | ||
| ScriptDirectory: "$(Agent.TempDirectory)/eng/common/scripts" | ||
|
|
||
| - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml | ||
| parameters: | ||
| Paths: | ||
|
|
@@ -195,7 +214,7 @@ | |
| WorkingDirectory: $(SdkRepoDirectory) | ||
| SkipCheckoutNone: true | ||
| ${{ if and(eq(variables['System.TeamProject'], 'internal'), endsWith(variables['Build.Repository.Name'], '-pr')) }}: | ||
| TokenToUseForAuth: $(azuresdk-github-pat) | ||
| TokenToUseForAuth: $(GH_TOKEN) | ||
| PreserveAuthToken: true | ||
|
|
||
| - task: UseNode@1 | ||
|
|
@@ -290,6 +309,8 @@ | |
| CustomCondition: and(succeededOrFailed(), ne(variables['StagedArtifactsFolder'], '')) | ||
|
|
||
| - ${{ 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 | ||
|
chidozieononiwu marked this conversation as resolved.
|
||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. script path would need to be specified. |
||
| - pwsh: | | ||
| $sdkPrBranchName = "$(PrBranch)-$(Build.BuildId)" | ||
| $sdkRepoBranch = '${{ parameters.SdkRepoBranch }}' | ||
|
|
@@ -348,7 +369,7 @@ | |
| -BaseBranch "main" | ||
| -PROwner "$(SdkRepoOwner)" | ||
| -PRBranch "$(SdkPullRequestSourceBranch)" | ||
| -AuthToken "$(azuresdk-github-pat)" | ||
| -AuthToken "$(GH_TOKEN)" | ||
| -PRTitle "$(PrTitle)-generated-from-$(Build.DefinitionName)-$(Build.BuildId)" | ||
| -PRBody "$(GeneratedSDKInformation) $(ReleasePlanInfo)" | ||
| -OpenAsDraft $${{ not(endsWith(parameters.TriggerSource, '-release')) }} | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.