diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 3f14d12873..77a95d0816 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,10 +1,11 @@ +bug_report.md --- + name: Bug report about: Create a report to help us improve title: '' -labels: '' +labels: ['bug'] assignees: '' - --- **Describe the bug** @@ -22,7 +23,9 @@ Steps to reproduce the behavior: A clear and concise description of what you expected to happen. **Are you going to work on fixing this?** -No. + +- [ ] Yes +- [x] No **Screenshots** If applicable, add screenshots to help explain your problem. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index bbcbbe7d61..703cae40fc 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,9 +2,8 @@ name: Feature request about: Suggest an idea for this project title: '' -labels: '' +labels: ['enhancement'] assignees: '' - --- **Is your feature request related to a problem? Please describe.** @@ -16,5 +15,10 @@ A clear and concise description of what you want to happen. **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. +**Are you going to work on implementing this?** + +- [ ] Yes +- [x] No + **Additional context** Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/label-issues.yaml b/.github/workflows/label-issues.yaml new file mode 100644 index 0000000000..52d1df4330 --- /dev/null +++ b/.github/workflows/label-issues.yaml @@ -0,0 +1,37 @@ +name: "Auto Label Issues" +on: + issues: + types: + - edited + - opened + +jobs: + label: + runs-on: ubuntu-latest + steps: + - name: Apply Labels to Issues + uses: actions/github-script@v7.0.1 + with: + script: | + const issue = context.payload.issue; + const keywords = { + "bug": ["error", "failure", "not working"], + "enhancement": ["add", "feature request", "improve"], + "question": ["clarification", "help", "how to"] + }; + + let labels = []; + for (const [label, words] of Object.entries(keywords)) { + if (words.some(word => issue.title.toLowerCase().includes(word) || issue.body.toLowerCase().includes(word))) { + labels.push(label); + } + } + + if (labels.length > 0) { + github.rest.issues.addLabels({ + issue_number: context.issue.number, + labels: labels, + owner: context.repo.owner, + repo: context.repo.repo + }); + }