Skip to content

Commit 812849c

Browse files
iscai-msftCopilot
andcommitted
Trigger azure-sdk-for-python regeneration after publish
Add repository_dispatch step to the Python emitter publish stage. Uses login-to-github.yml to mint a GitHub App token via Azure Key Vault, then dispatches typespec-python-regenerate event to Azure/azure-sdk-for-python with the source commit SHA. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent ef146dd commit 812849c

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

eng/emitters/pipelines/templates/stages/emitter-stages.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,18 @@ stages:
375375
inlineScript: node ./eng/emitters/scripts/upload-bundled-emitter.js ${{ parameters.PackagePath }}
376376
workingDirectory: $(Build.SourcesDirectory)
377377

378+
# Notify downstream repos of the new release
379+
- ${{ if eq(parameters.LanguageShortName, 'python') }}:
380+
- template: /eng/common/pipelines/templates/steps/login-to-github.yml
381+
- script: |
382+
curl -f -X POST \
383+
-H "Accept: application/vnd.github+json" \
384+
-H "Authorization: Bearer $(GH_TOKEN)" \
385+
https://api.github.com/repos/Azure/azure-sdk-for-python/dispatches \
386+
-d '{"event_type":"typespec-python-regenerate","client_payload":{"sha":"$(Build.SourceVersion)"}}'
387+
displayName: Trigger azure-sdk-for-python regeneration
388+
condition: succeeded()
389+
378390
templateContext:
379391
outputs:
380392
- output: pipelineArtifact

0 commit comments

Comments
 (0)