-
Notifications
You must be signed in to change notification settings - Fork 1.9k
91 lines (81 loc) · 2.82 KB
/
triage.yml
File metadata and controls
91 lines (81 loc) · 2.82 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: "AI Triage"
on:
# When someone opens a new issue
issues:
types: [opened]
# When someone adds the "/triage" comments
issue_comment:
types: [created, edited]
# When the workflow is run manually
workflow_dispatch:
inputs:
issue_number:
description: 'Issue number to triage'
required: true
type: number
permissions:
contents: read
issues: write
models: read
jobs:
triage-issue:
name: Apply Labels
runs-on: ubuntu-latest
if: |
github.repository_owner == 'dotnet' &&
(github.event_name == 'issues' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/triage')))
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get Issue or PR Number
id: get-number
shell: pwsh
run: |
if ("${{ github.event_name }}" -eq "workflow_dispatch") {
echo "number=${{ inputs.issue_number }}" >> $env:GITHUB_OUTPUT
} else {
echo "number=${{ github.event.issue.number }}" >> $env:GITHUB_OUTPUT
}
- name: Determine PLATFORM label for the issue
id: triage-platform
uses: ./.github/actions/triage-labels
with:
issue: ${{ steps.get-number.outputs.number }}
label-prefix: 'platform/'
mode: 'multi-label'
- name: Determine AREA label for the issue
id: triage-area
uses: ./.github/actions/triage-labels
with:
issue: ${{ steps.get-number.outputs.number }}
label-prefix: 'area-'
mode: 'single-label'
- name: Determine REGRESSION label for the issue
id: triage-regression
uses: ./.github/actions/triage-labels
with:
issue: ${{ steps.get-number.outputs.number }}
label: 'potential-regression'
mode: 'regression'
# TODO: fix this prompt as it is not working correctly
# - name: Determine MISSING INFO labels for the issue
# id: triage-missing-info
# uses: ./.github/actions/triage-labels
# with:
# issue: ${{ steps.get-number.outputs.number }}
# mode: 'missing-info'
- name: Log Labels
run: |
cat "${{ steps.triage-platform.outputs.response-file }}"
cat "${{ steps.triage-area.outputs.response-file }}"
cat "${{ steps.triage-regression.outputs.response-file }}"
- name: Apply Labels and Comment
# TODO: delete this condition when we are ready!
if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '/triage'))
uses: ./.github/actions/triage-apply
with:
issue: ${{ steps.get-number.outputs.number }}