Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 23 additions & 7 deletions eng/common/pipelines/templates/archetype-typespec-emitter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ extends:
- job: Initialize
steps:
- checkout: self

- template: /eng/common/pipelines/templates/steps/login-to-github.yml
parameters:
TokenOwners:
- Azure

Comment thread
scbedd marked this conversation as resolved.
- task: UseNode@1
displayName: 'Install Node.js'
Expand Down Expand Up @@ -355,14 +360,15 @@ extends:

- template: /eng/common/pipelines/templates/steps/git-push-changes.yml
parameters:
BaseRepoOwner: azure-sdk
BaseRepoOwner: Azure
TargetRepoName: $(Build.Repository.Name)
BaseRepoBranch: $(branchName)
CommitMsg: Regenerate repository SDK with TypeSpec build $(Build.BuildNumber)
WorkingDirectory: $(Build.SourcesDirectory)
ScriptDirectory: $(Build.SourcesDirectory)/eng/common/scripts
# To accomodate scheduled runs and retries, we want to overwrite any existing changes on the branch
PushArgs: --force
AuthToken: $(GH_TOKEN)

- task: PowerShell@2
displayName: Get generation job matrix
Expand Down Expand Up @@ -390,13 +396,17 @@ extends:
matrix: $[dependencies.Initialize.outputs['generate_matrix.matrix']]
variables:
matrixArtifactsPath: $(Pipeline.Workspace)/matrix_artifacts
AzureSdkRepoName: $[format('azure-sdk/{0}', split(variables['Build.Repository.Name'], '/')[1])]
emitterNpmrcPath: $(Agent.TempDirectory)/${{ parameters.EmitterPackagePath }}/.npmrc
steps:
- checkout: self

- template: /eng/common/pipelines/templates/steps/login-to-github.yml
parameters:
TokenOwners:
- Azure

Comment thread
scbedd marked this conversation as resolved.
- pwsh: |
git remote add azure-sdk https://github.com/$(AzureSdkRepoName).git
git fetch azure-sdk $(branchName)
git fetch origin $(branchName)
git switch $(branchName)
displayName: 'Checkout PR branch $(branchName)'

Expand Down Expand Up @@ -428,12 +438,13 @@ extends:

- template: /eng/common/pipelines/templates/steps/git-push-changes.yml
parameters:
BaseRepoOwner: azure-sdk
BaseRepoOwner: Azure
TargetRepoName: $(Build.Repository.Name)
BaseRepoBranch: $(branchName)
CommitMsg: Update SDK code $(JobKey)
WorkingDirectory: $(Build.SourcesDirectory)
ScriptDirectory: $(Build.SourcesDirectory)/eng/common/scripts
AuthToken: $(GH_TOKEN)

- job: Create_PR
displayName: Create PR
Expand All @@ -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)'
Expand Down Expand Up @@ -532,9 +548,9 @@ extends:
-RepoOwner '$(RepoOwner)'
-RepoName '$(RepoName)'
-BaseBranch '$(pullRequestTargetBranch)'
-PROwner 'azure-sdk'
-PROwner 'Azure'
-PRBranch '$(branchName)'
-AuthToken '$(azuresdk-github-pat)'
-AuthToken '$(GH_TOKEN)'
-PRTitle '$(PullRequestTitle)'
-PRBody '$(PullRequestBody)'
-OpenAsDraft $$(OpenAsDraft)
Expand Down
5 changes: 4 additions & 1 deletion eng/common/pipelines/templates/jobs/prepare-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down