-
Notifications
You must be signed in to change notification settings - Fork 5.8k
58 lines (50 loc) · 1.67 KB
/
Copy pathupdate-labels.yaml
File metadata and controls
58 lines (50 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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 - Set Status",
"ARM Modeling Review",
"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-slim
steps:
- uses: actions/checkout@v6
with:
sparse-checkout: |
.github
- name: Update Labels
id: update-labels
uses: actions/github-script@v8
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 }}