name: Issue Triage

on:
  issues:
    types: [opened]

jobs:
  triage:
    if: github.actor != 'codeninja'
    runs-on: ubuntu-latest
    permissions:
      issues: write
    steps:
      - name: Add triage label
        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: ['triage']
            });
