-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
91 lines (87 loc) · 2.88 KB
/
issue-package-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
name: 'Automation: Tag issue with package 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 used package 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: '### Which SDK are you using\?\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: |
{
"@sentry.astro": {
"label": "Package: Astro"
},
"@sentry.browser": {
"label": "Package: Browser"
},
"@sentry.angular": {
"label": "Package: Angular"
},
"@sentry.bun": {
"label": "Package: Bun"
},
"@sentry.ember": {
"label": "Package: ember"
},
"@sentry.gatsby": {
"label": "Package: gatbsy"
},
"@sentry.nextjs": {
"label": "Package: Nextjs"
},
"@sentry.node": {
"label": "Package: Node"
},
"@sentry.react": {
"label": "Package: react"
},
"@sentry.remix": {
"label": "Package: remix"
},
"@sentry.serverless": {
"label": "Package: Serverless"
},
"@sentry.sveltekit": {
"label": "Package: SvelteKit"
},
"@sentry.svelte": {
"label": "Package: svelte"
},
"@sentry.vue": {
"label": "Package: vue"
},
"@sentry.wasm": {
"label": "Package: wasm"
},
"Sentry.Browser.Loader": {
"label": "Package-Meta: Loader"
},
"Sentry.Browser.CDN.bundle": {
"label": "Package-Meta: CDN"
}
}
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 }}