Update web/src/components/FileListing.js #29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Issue Management Automation | ||
| on: | ||
| issues: | ||
| types: [opened, edited, labeled, assigned] | ||
| issue_comment: | ||
| types: [created] | ||
| permissions: | ||
| issues: write | ||
| contents: read | ||
| jobs: | ||
| auto-label: | ||
| runs-on: ubuntu-latest | ||
| if: github.event.action == 'opened' | ||
| steps: | ||
| - name: Auto-label by title | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const title = context.payload.issue.title.toLowerCase(); | ||
| const body = context.payload.issue.body?.toLowerCase() || ''; | ||
| const labels = []; | ||
| // Category labels | ||
| if (title.includes('docker') || body.includes('docker')) labels.push('docker'); | ||
| if (title.includes('kubernetes') || title.includes('k8s')) labels.push('kubernetes'); | ||
| if (title.includes('ai') || title.includes('llm') || title.includes('agent')) labels.push('ai-ml'); | ||
| if (title.includes('python')) labels.push('python'); | ||
| if (title.includes('typescript') || title.includes('javascript')) labels.push('typescript'); | ||
| if (title.includes('documentation') || title.includes('docs')) labels.push('documentation'); | ||
| if (title.includes('example') || title.includes('template')) labels.push('examples'); | ||
| if (title.includes('bug') || title.includes('error') || title.includes('issue')) labels.push('bug'); | ||
| if (title.includes('feature') || title.includes('enhancement')) labels.push('enhancement'); | ||
| if (title.includes('ci/cd') || title.includes('workflow')) labels.push('ci-cd'); | ||
| // Priority labels | ||
| if (title.includes('urgent') || title.includes('critical')) labels.push('priority:high'); | ||
| if (title.includes('question') || title.includes('help')) labels.push('question'); | ||
| // Add labels | ||
| if (labels.length > 0) { | ||
| await github.rest.issues.addLabels({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.issue.number, | ||
| labels: labels | ||
| }); | ||
| } | ||
| auto-assign: | ||
| runs-on: ubuntu-latest | ||
| if: github.event.action == 'opened' | ||
| steps: | ||
| - name: Auto-assign to project | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const title = context.payload.issue.title.toLowerCase(); | ||
| // Add comment with instructions | ||
| const comment = `Thank you for creating this issue! 🎉 | ||
| This issue has been automatically labeled based on its content. | ||
| **Next Steps:** | ||
| - A maintainer will review this issue soon | ||
| - Please provide additional details if needed | ||
| - Check related issues for similar topics | ||
| **Helpful Resources:** | ||
| - [Documentation Index](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/main/documentation/INDEX.md) | ||
| - [Quick Start Guide](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/main/documentation/QUICKSTART.md) | ||
| - [Examples](https://github.com/${context.repo.owner}/${context.repo.repo}/tree/main/documentation/examples_scripts) | ||
| `; | ||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.issue.number, | ||
| body: comment | ||
| }); | ||
| link-related: | ||
| runs-on: ubuntu-latest | ||
| if: github.event.action == 'opened' | ||
| steps: | ||
| - name: Find related issues | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const title = context.payload.issue.title; | ||
| const keywords = title.toLowerCase().split(' ').filter(word => word.length > 4); | ||
| // Search for related issues | ||
| const { data: issues } = await github.rest.search.issuesAndPullRequests({ | ||
| q: `repo:${context.repo.owner}/${context.repo.repo} is:issue ${keywords.slice(0, 3).join(' ')}`, | ||
| per_page: 5 | ||
| }); | ||
| // Filter out current issue | ||
| const related = issues.items.filter(i => i.number !== context.issue.number); | ||
| if (related.length > 0) { | ||
| const relatedList = related.map(i => `- #${i.number}: ${i.title}`).join('\n'); | ||
| const comment = `### Related Issues\n\n${relatedList}\n\n*These issues might be related to your topic.*`; | ||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.issue.number, | ||
| body: comment | ||
| }); | ||
| } | ||