SDK Breaking Change Labels #266525
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SDK Breaking Change Labels | |
on: | |
check_run: | |
types: [completed] | |
permissions: | |
contents: read | |
jobs: | |
sdk-breaking-change-labels: | |
# Only run this job when the check run is from Azure Pipelines SDK Generation job in the azure-sdk/public(id: 29ec6040-b234-4e31-b139-33dc4287b756) project | |
if: | | |
github.event.check_run.check_suite.app.name == 'Azure Pipelines' && | |
contains(github.event.check_run.name, 'SDK Validation') && | |
endsWith(github.event.check_run.external_id, '29ec6040-b234-4e31-b139-33dc4287b756') | |
name: SDK Breaking Change Labels | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
sparse-checkout: | | |
.github | |
- name: Get label and action | |
id: get-label-and-action | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const { getLabelAndAction } = | |
await import('${{ github.workspace }}/.github/workflows/src/sdk-breaking-change-labels.js'); | |
return await getLabelAndAction({ github, context, core }); | |
- if: | | |
(fromJson(steps.get-label-and-action.outputs.result).labelAction == 'add' || | |
fromJson(steps.get-label-and-action.outputs.result).labelAction == 'remove') | |
name: Upload artifact with results | |
uses: ./.github/actions/add-label-artifact | |
with: | |
name: "${{ fromJson(steps.get-label-and-action.outputs.result).labelName}}" | |
# Convert "add/remove" to "true/false" | |
value: "${{ fromJson(steps.get-label-and-action.outputs.result).labelAction == 'add' }}" | |
- if: | | |
(fromJson(steps.get-label-and-action.outputs.result).labelAction == 'add' || | |
fromJson(steps.get-label-and-action.outputs.result).labelAction == 'remove') | |
name: Upload artifact with issue number | |
uses: ./.github/actions/add-empty-artifact | |
with: | |
name: "issue-number" | |
value: "${{ fromJson(steps.get-label-and-action.outputs.result).issueNumber }}" |