Skip to content

Update Labels

Update Labels #510311

name: Update Labels
on:
# TODO: If a pull request is manually labeled or unlabeled, get all artifacts associated with PR, and update labels
# pull_request:
# types: [labeled, unlabeled]
# If an upstream workflow if completed, get only the artifacts from that workflow, and update labels
workflow_run:
workflows:
[
"ARM Auto SignOff",
"SDK Breaking Change Labels",
"SDK Suppressions",
"TypeSpec Requirement",
"Breaking Change - Add Label Artifacts",
]
types: [completed]
permissions:
actions: read
contents: read
pull-requests: write
jobs:
update-labels:
name: Update Labels
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
- name: Update Labels
id: update-labels
uses: actions/github-script@v7
with:
script: |
const { default: updateLabels } =
await import('${{ github.workspace }}/.github/workflows/src/update-labels.js');
await updateLabels({ github, context, core });
- if: ${{ always() && steps.update-labels.outputs.head_sha }}
name: Upload artifact with head SHA
uses: ./.github/actions/add-empty-artifact
with:
name: head-sha
value: ${{ steps.update-labels.outputs.head_sha }}
- if: ${{ always() && steps.update-labels.outputs.issue_number }}
name: Upload artifact with issue number
uses: ./.github/actions/add-empty-artifact
with:
name: issue-number
value: ${{ steps.update-labels.outputs.issue_number }}