Skip to content

Add GitHub Actions workflow to auto-label new issues with "needs triage" #201

@ncarenton

Description

@ncarenton

Context

Issue templates already include the needs triage label in their front matter, but this only covers issues created through the template chooser. Issues created via the API, blank issues, or issues where users manually clear labels bypass the templates and miss the label.

Proposed Solution

Add a GitHub Actions workflow (.github/workflows/auto-label-issues.yml) that triggers on issues: opened and applies the needs triage label to every newly created issue.

Suggested implementation

name: Auto-label new issues
on:
  issues:
    types: [opened]

jobs:
  add-needs-triage:
    runs-on: ubuntu-latest
    permissions:
      issues: write
    steps:
      - uses: actions/github-script@v7
        with:
          script: |
            await github.rest.issues.addLabels({
              owner: context.repo.owner,
              repo: context.repo.repo,
              issue_number: context.issue.number,
              labels: ['needs triage']
            });

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions