diff options
| author | 2026-01-16 04:01:19 +0100 | |
|---|---|---|
| committer | 2026-01-16 04:01:19 +0100 | |
| commit | 83027c383f26f772842771a6d670642fd36c269a (patch) | |
| tree | 798f34d2a18c331b16ce6daf39b3f0dae3a8d924 /.github/workflows/issue-checker.yml | |
| parent | 88d2b67870203acc098ae09e3cc33009c4e6b6ad (diff) | |
| download | DropOut-83027c383f26f772842771a6d670642fd36c269a.tar.gz DropOut-83027c383f26f772842771a6d670642fd36c269a.zip | |
chore: add GitHub issue and PR templates with automation workflows
- Add bilingual issue templates (English & Chinese)
- Bug report template with prerequisite checkboxes
- Feature request template
- Question template
- Reverse checkbox detection ("I have not read carefully")
- Add bilingual PR templates (English & Chinese)
- Comprehensive checklist for code quality and testing
- Test environment documentation section
- Breaking changes section
- Add GitHub Actions workflows
- Auto-labeling based on issue content
- Auto-close issues with unchecked prerequisites
- Stale issue and PR management (90/60 days)
- Add template configuration
- External links for discussions and wiki
- Template chooser interface
Diffstat (limited to '.github/workflows/issue-checker.yml')
| -rw-r--r-- | .github/workflows/issue-checker.yml | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/.github/workflows/issue-checker.yml b/.github/workflows/issue-checker.yml new file mode 100644 index 0000000..a598488 --- /dev/null +++ b/.github/workflows/issue-checker.yml @@ -0,0 +1,84 @@ +name: Issue Checker + +on: + issues: + types: [opened, edited] + pull_request_target: + types: [opened, edited] + +permissions: + issues: write + pull-requests: write + +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Check and Label Issues + uses: actions/github-script@v7 + with: + script: | + const issue = context.payload.issue || context.payload.pull_request; + if (!issue) return; + + const body = issue.body || ''; + const title = issue.title || ''; + const isIssue = !!context.payload.issue; + const issueNumber = issue.number; + + // Skip if "I have not read carefully" is checked - handled by issue-checkbox-checker.yml + const hasNotReadChecked = + body.includes('- [x] I have not read carefully') || + body.includes('- [X] I have not read carefully') || + body.includes('- [x] 我未仔细阅读') || + body.includes('- [X] 我未仔细阅读'); + + if (hasNotReadChecked) { + // Let issue-checkbox-checker handle this + return; + } + + const labels = []; + + // Platform labels + if (body.match(/Windows|windows/i)) labels.push('platform: windows'); + if (body.match(/macOS|macos|Mac/i)) labels.push('platform: macos'); + if (body.match(/Linux|linux|Ubuntu|Debian|Arch|Fedora/i)) labels.push('platform: linux'); + + // Mod loader labels + if (body.match(/Fabric/i)) labels.push('mod-loader: fabric'); + if (body.match(/Forge/i)) labels.push('mod-loader: forge'); + + // Java related + if (body.match(/Java|java|JRE|JDK/i)) labels.push('java'); + + // Authentication issues + if (body.match(/login|authentication|Microsoft|Xbox|account/i)) labels.push('authentication'); + + // Download issues + if (body.match(/download|downloading|assets|libraries/i)) labels.push('download'); + + // Launch issues + if (body.match(/launch|start|won't start|crash|crashed/i)) labels.push('launch'); + + // UI issues + if (body.match(/UI|interface|display|rendering|visual/i)) labels.push('ui'); + + // Performance issues + if (body.match(/slow|performance|lag|freeze|hang/i)) labels.push('performance'); + + // Check for unclear titles + if (isIssue && (title.length < 10 || + title.match(/^(help|问题|stuck|卡住|error|错误|bug)$/i))) { + labels.push('needs-clarification'); + } + + // Apply labels + if (labels.length > 0) { + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issue.number, + labels: labels + }); + } |