# Auto-labels new issues and PRs using mux.
# SETUP: Add ANTHROPIC_API_KEY to repository secrets.
# Fork PRs are skipped (no secret access).
name: Auto-Label
on:
issues:
types: [opened]
pull_request:
types: [opened]
permissions:
issues: write
pull-requests: write
jobs:
label:
runs-on: ubuntu-latest
if: github.actor != 'dependabot[bot]'
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- name: Label with mux
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TYPE: ${{ github.event_name == 'pull_request' && 'pr' || 'issue' }}
NUMBER: ${{ github.event.issue.number || github.event.pull_request.number }}
run: |
[ -z "$ANTHROPIC_API_KEY" ] && echo "Skipping (no API key)" && exit 0
bunx mux@next run --budget 0.50 "
Label this GitHub $TYPE using ONLY existing labels. Steps:
1. gh label list --json name,description
2. gh $TYPE view $NUMBER
3. gh $TYPE edit $NUMBER --add-label <labels>
Pick 1-3 labels from the list in step 1. Do NOT create new labels.
If no existing labels fit well, skip step 3.
"