Skip to content
Closed
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
25 changes: 23 additions & 2 deletions eng/pipelines/templates/stages/archetype-spec-gen-sdk.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
parameters:
- name: SpecRepoUrl
type: string
Expand Down Expand Up @@ -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')) }}:
Comment thread
chidozieononiwu marked this conversation as resolved.
- 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.

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.

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:
Expand All @@ -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
Expand Down Expand Up @@ -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
Comment thread
chidozieononiwu marked this conversation as resolved.

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.

- pwsh: |
$sdkPrBranchName = "$(PrBranch)-$(Build.BuildId)"
$sdkRepoBranch = '${{ parameters.SdkRepoBranch }}'
Expand Down Expand Up @@ -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')) }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
parameters:
# Sample change used to exercise API documentation preview validation.
"service-dir":
default: "sdk/contosowidgetmanager"
"dependencies":
Expand Down
Loading