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 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}`); + } + }