From 10ae88a1c396b33b3429aa50bd4480b81a519f9f Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Mon, 2 Mar 2026 12:05:00 +0100 Subject: [PATCH 1/2] feat: add workflow that aut-labels bug reports based on entered content Signed-off-by: Simon L. --- .github/workflows/bug-report-labeler.yml | 45 ++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/bug-report-labeler.yml diff --git a/.github/workflows/bug-report-labeler.yml b/.github/workflows/bug-report-labeler.yml new file mode 100644 index 0000000000000..743713dec1a0e --- /dev/null +++ b/.github/workflows/bug-report-labeler.yml @@ -0,0 +1,45 @@ +# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: AGPL-3.0-or-later + +name: Auto-label bug reports +on: + issues: + types: [opened] + +jobs: + add-version-label: + if: contains(github.event.issue.title, '[Bug]') + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Extract version number and apply label + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 + with: + script: | + const body = context.payload.issue.body || ''; + const normalizedBody = body.replace(/\r\n?/g, '\n'); + let label = ''; + + // Extract Nextcloud Server version number from a block like: + // ### Nextcloud Server version + // 32 + const versionMatch = normalizedBody.match(/### Nextcloud Server version\s*\n+([0-9]{1,3})\b/); + let nextcloudVersion = null; + if (versionMatch) { + nextcloudVersion = parseInt(versionMatch[1], 10); + label = nextcloudVersion + '-feedback'; + } + + if (label) { + try { + await github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: [label] + }); + } catch (error) { + core.setFailed(`Failed to add label "${label}": ${error.message || error}`); + } + } From e0bf0737a00680739ff4bd1a481d4992b6ee531d Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Mon, 2 Mar 2026 12:07:39 +0100 Subject: [PATCH 2/2] fix: adjust the bug-report template to be consistent Signed-off-by: Simon L. --- .github/ISSUE_TEMPLATE/BUG_REPORT.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/BUG_REPORT.yml b/.github/ISSUE_TEMPLATE/BUG_REPORT.yml index 8652ac7df93df..4a258a23e25d0 100644 --- a/.github/ISSUE_TEMPLATE/BUG_REPORT.yml +++ b/.github/ISSUE_TEMPLATE/BUG_REPORT.yml @@ -73,7 +73,7 @@ body: options: - "32" - "33" - - "master" + - "34 (master)" validations: required: true - type: dropdown