|
| 1 | +trigger: none |
| 2 | + |
| 3 | +extends: |
| 4 | + template: /eng/pipelines/templates/stages/1es-redirect.yml |
| 5 | + parameters: |
| 6 | + oneESTemplateTag: ${{ parameters.oneESTemplateTag }} |
| 7 | + stages: |
| 8 | + - stage: TspSpecSync |
| 9 | + jobs: |
| 10 | + - job: TspSpecSync |
| 11 | + displayName: 'TSP Spec Sync Job' |
| 12 | + pool: |
| 13 | + name: 'azsdk-pool' |
| 14 | + image: 'ubuntu-24.04' |
| 15 | + os: 'linux' |
| 16 | + steps: |
| 17 | + - task: UsePythonVersion@0 |
| 18 | + displayName: 'Set up Python' |
| 19 | + inputs: |
| 20 | + versionSpec: '3.10' |
| 21 | + addToPath: true |
| 22 | + |
| 23 | + - script: | |
| 24 | + npm install -g @azure-tools/typespec-client-generator-cli@latest |
| 25 | + displayName: 'Install tsp-client' |
| 26 | +
|
| 27 | + - script: | |
| 28 | + git config --global user.name "ADO Pipeline" |
| 29 | + git config --global user.email "[email protected]" |
| 30 | + displayName: 'Configure Git' |
| 31 | +
|
| 32 | + - script: | |
| 33 | + tsp-client update --local-spec-repo ../../specs/scratch/ |
| 34 | + displayName: 'Run TSP Client Update' |
| 35 | + workingDirectory: ./sdk/core/azure-core/tests/specs_sdk/scratch |
| 36 | +
|
| 37 | + - script: | |
| 38 | + changes=$(git status --porcelain) |
| 39 | + if [ -n "$changes" ]; then |
| 40 | + echo "##vso[task.setvariable variable=hasChanges]true" |
| 41 | + else |
| 42 | + echo "##vso[task.setvariable variable=hasChanges]false" |
| 43 | + fi |
| 44 | + displayName: 'Check for changes' |
| 45 | +
|
| 46 | + - template: /eng/common/pipelines/templates/steps/create-pull-request.yml |
| 47 | + parameters: |
| 48 | + PRBranchName: 'automated/tsp-update-$(date +%Y%m%d%H%M%S)' |
| 49 | + PRTitle: 'Auto-update TSP client generated code' |
| 50 | + PRBody: | |
| 51 | + This PR was automatically created in response to changes in `emitter-package.json`. |
| 52 | +
|
| 53 | + It updates the TSP client generated code. Tests should run automatically as part of the PR validation. |
| 54 | +
|
| 55 | + Generated from workflow triggered by PR #$(System.PullRequest.PullRequestNumber). |
| 56 | + CommitMsg: 'Auto-update TSP client generated code' |
| 57 | + condition: eq(variables['hasChanges'], 'true') |
0 commit comments