diff --git a/eng/common/pipelines/templates/archetype-typespec-emitter.yml b/eng/common/pipelines/templates/archetype-typespec-emitter.yml index d0a83041cdab..2107c1292554 100644 --- a/eng/common/pipelines/templates/archetype-typespec-emitter.yml +++ b/eng/common/pipelines/templates/archetype-typespec-emitter.yml @@ -304,6 +304,11 @@ extends: - job: Initialize steps: - checkout: self + + - template: /eng/common/pipelines/templates/steps/login-to-github.yml + parameters: + TokenOwners: + - azure-sdk - task: UseNode@1 displayName: 'Install Node.js' @@ -394,6 +399,12 @@ extends: emitterNpmrcPath: $(Agent.TempDirectory)/${{ parameters.EmitterPackagePath }}/.npmrc steps: - checkout: self + + - template: /eng/common/pipelines/templates/steps/login-to-github.yml + parameters: + TokenOwners: + - azure-sdk + - pwsh: | git remote add azure-sdk https://github.com/$(AzureSdkRepoName).git git fetch azure-sdk $(branchName) @@ -447,6 +458,11 @@ extends: steps: - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml + - template: /eng/common/pipelines/templates/steps/login-to-github.yml + parameters: + TokenOwners: + - Azure + - pwsh: | $generateJobResult = '$(generateJobResult)' $emitterVersion = '$(emitterVersion)' @@ -534,7 +550,7 @@ extends: -BaseBranch '$(pullRequestTargetBranch)' -PROwner 'azure-sdk' -PRBranch '$(branchName)' - -AuthToken '$(azuresdk-github-pat)' + -AuthToken '$(GH_TOKEN)' -PRTitle '$(PullRequestTitle)' -PRBody '$(PullRequestBody)' -OpenAsDraft $$(OpenAsDraft) diff --git a/eng/common/pipelines/templates/jobs/prepare-pipelines.yml b/eng/common/pipelines/templates/jobs/prepare-pipelines.yml index 46d2d0babb7f..f8523ad59983 100644 --- a/eng/common/pipelines/templates/jobs/prepare-pipelines.yml +++ b/eng/common/pipelines/templates/jobs/prepare-pipelines.yml @@ -39,6 +39,9 @@ jobs: APIReview_AutoCreate_Configurations: 93 steps: + - ${{ if endsWith(parameters.Repository, '-pr') }}: + - template: /eng/common/pipelines/templates/steps/login-to-github.yml + - template: /eng/common/pipelines/templates/steps/sparse-checkout.yml parameters: Repositories: @@ -52,7 +55,7 @@ jobs: - '!sdk/**/SessionRecords/*' - '!sdk/**/session-records/*' ${{ if endsWith(parameters.Repository, '-pr') }}: - TokenToUseForAuth: $(azuresdk-github-pat) + TokenToUseForAuth: $(GH_TOKEN) - template: /eng/common/pipelines/templates/steps/install-pipeline-generation.yml - template: /eng/common/pipelines/templates/steps/set-default-branch.yml