[Feature]: allow the footer info banner to auto-hide #15
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: Auto Label Issues | |
| on: | |
| issues: | |
| types: [opened] | |
| jobs: | |
| label: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| issues: write | |
| steps: | |
| - name: Auto-label by type | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const issue = context.payload.issue; | |
| const title = issue.title.toLowerCase(); | |
| const body = issue.body || ''; | |
| // Issue templates already add these labels via YAML, | |
| // but this catches issues created without templates | |
| const labels = []; | |
| // Backup labeling if templates don't fire | |
| if (!issue.labels || issue.labels.length === 0) { | |
| if (title.includes('[bug]')) { | |
| labels.push('bug', 'needs-triage'); | |
| } else if (title.includes('[feature]')) { | |
| labels.push('enhancement', 'needs-review'); | |
| } else if (title.includes('[question]')) { | |
| labels.push('question'); | |
| } else { | |
| // Fallback for issues without template | |
| labels.push('needs-triage'); | |
| } | |
| if (labels.length > 0) { | |
| await github.rest.issues.addLabels({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: issue.number, | |
| labels | |
| }); | |
| } | |
| } |