forked from getsentry/sentry-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (108 loc) · 3.57 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
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/variable-mapper@v0.3.0
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.angular": {
"label": "Package: angular"
},
"@sentry.astro": {
"label": "Package: astro"
},
"@sentry.aws-serverless": {
"label": "Package: aws-serverless"
},
"@sentry.browser": {
"label": "Package: browser"
},
"@sentry.bun": {
"label": "Package: bun"
},
"@sentry.cloudflare": {
"label": "Package: cloudflare"
},
"@sentry.deno": {
"label": "Package: deno"
},
"@sentry.ember": {
"label": "Package: ember"
},
"@sentry.gatsby": {
"label": "Package: gatbsy"
},
"@sentry.google-cloud-serverless": {
"label": "Package: google-cloud-serverless"
},
"@sentry.nestjs": {
"label": "Package: nestjs"
},
"@sentry.nextjs": {
"label": "Package: nextjs"
},
"@sentry.node": {
"label": "Package: node"
},
"@sentry.nuxt": {
"label": "Package: nuxt"
},
"@sentry.react": {
"label": "Package: react"
},
"@sentry.remix": {
"label": "Package: remix"
},
"@sentry.solid": {
"label": "Package: solid"
},
"@sentry.solid": {
"label": "Package: solidstart"
},
"@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 }}