File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7373 options :
7474 - " 32"
7575 - " 33"
76- - " master"
76+ - " 34 ( master) "
7777 validations :
7878 required : true
7979 - type : dropdown
Original file line number Diff line number Diff line change 1+ # SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
2+ # SPDX-License-Identifier: AGPL-3.0-or-later
3+
4+ name : Auto-label bug reports
5+ on :
6+ issues :
7+ types : [opened]
8+
9+ jobs :
10+ add-version-label :
11+ if : contains(github.event.issue.title, '[Bug]')
12+ runs-on : ubuntu-latest
13+ permissions :
14+ issues : write
15+ steps :
16+ - name : Extract version number and apply label
17+ uses : actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
18+ with :
19+ script : |
20+ const body = context.payload.issue.body || '';
21+ const normalizedBody = body.replace(/\r\n?/g, '\n');
22+ let label = '';
23+
24+ // Extract Nextcloud Server version number from a block like:
25+ // ### Nextcloud Server version
26+ // 32
27+ const versionMatch = normalizedBody.match(/### Nextcloud Server version\s*\n+([0-9]{1,3})\b/);
28+ let nextcloudVersion = null;
29+ if (versionMatch) {
30+ nextcloudVersion = parseInt(versionMatch[1], 10);
31+ label = nextcloudVersion + '-feedback';
32+ }
33+
34+ if (label) {
35+ try {
36+ await github.rest.issues.addLabels({
37+ issue_number: context.issue.number,
38+ owner: context.repo.owner,
39+ repo: context.repo.repo,
40+ labels: [label]
41+ });
42+ } catch (error) {
43+ core.setFailed(`Failed to add label "${label}": ${error.message || error}`);
44+ }
45+ }
You can’t perform that action at this time.
0 commit comments