Skip to content

[Feature]: allow the footer info banner to auto-hide #15

[Feature]: allow the footer info banner to auto-hide

[Feature]: allow the footer info banner to auto-hide #15

Workflow file for this run

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