-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
118 lines (114 loc) · 3.61 KB
/
issue-sdk-label.yml
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: 'Tag issue with SDK label'
on:
issues:
types: [opened]
jobs:
add_labels:
name: Add package label
runs-on: ubuntu-latest
if: ${{ !github.event.issue.pull_request }}
steps:
- name: Get SDK name from issue body
# https://github.com/actions-ecosystem/action-regex-match
uses: actions-ecosystem/action-regex-match@v2
id: packageName
with:
# Parse used package from issue body
text: ${{ github.event.issue.body }}
regex: '### SDK\n\n(.*)\n\n'
- name: Map package to issue label
# https://github.com/kanga333/variable-mapper
uses: kanga333/[email protected]
id: packageLabel
if: steps.packageName.outputs.match != ''
with:
key: '${{ steps.packageName.outputs.group1 }}'
# Note: Since this is handled as a regex, and JSON parse wrangles slashes /, we just use `.` instead
map: |
{
"Android.SDK": {
"label": "Platform: Android"
},
"Apple.SDK": {
"label": "Platform: Cocoa"
},
"Dart.SDK": {
"label": "Platform: Dart"
},
"Elixir.SDK": {
"label": "Platform: Elixir"
},
"Flutter.SDK": {
"label": "Platform: Flutter"
},
"Go.SDK": {
"label": "Platform: Go"
},
"Java.SDK": {
"label": "Platform: Java"
},
"JavaScript.SDK": {
"label": "Platform: JavaScript"
},
"Kotlin.Multiplatform.SDK": {
"label": "Platform: KMP"
},
"Native.SDK": {
"label": "Platform: Native"
},
".NET.SDK": {
"label": "Platform: .NET"
},
"PHP.SDK": {
"label": "Platform: PHP"
},
"PowerShell.SDK": {
"label": "Platform: PowerShell"
},
"Python.SDK": {
"label": "Platform: Python"
},
"React.Native.SDK": {
"label": "Platform: React Native"
},
"Ruby.SDK": {
"label": "Platform: Ruby"
},
"Rust.SDK": {
"label": "Platform: Rust"
},
"Unity.SDK": {
"label": "Platform: Unity"
},
"Unreal.Engine.SDK": {
"label": "Platform: Unreal"
},
"Sentry.CLI": {
"label": "Platform: CLI"
},
"All.JavaScript.SDKs": {
"label": "Team: Web Frontend SDKs"
},
"All.Backend.SDKs": {
"label": "Team: Web Backend SDKs"
},
"All.Gaming.SDKs": {
"label": "Team: Web Backend SDKs"
},
"All.Mobile.SDKs": {
"label": "Team: Mobile Platform"
},
"All.SDKs": {
"label": "Team: SDKs"
},
"Other": {
"label": "Team: SDKs"
}
}
export_to: output
- name: Add package label if applicable
# Note: We only add the label if the issue is still open
if: steps.packageLabel.outputs.label != ''
uses: actions-ecosystem/action-add-labels@v1
with:
labels: ${{ steps.packageLabel.outputs.label }}