|
| 1 | +# |
| 2 | +# https://github.blog/open-source/maintainers/how-github-models-can-help-open-source-maintainers-focus-on-what-matters/ |
| 3 | +# |
| 4 | + |
| 5 | +name: Triage |
| 6 | + |
| 7 | +on: |
| 8 | + issues: |
| 9 | + types: [opened, reopened] |
| 10 | + pull_request: |
| 11 | + types: [opened, reopened] |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: ${{ github.workflow }}-${{ github.event.issue.number }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
| 17 | +jobs: |
| 18 | + # triage: |
| 19 | + # if: ${{ github.event.issue.user.type != 'Bot' }} |
| 20 | + # runs-on: ubuntu-latest |
| 21 | + # permissions: |
| 22 | + # models: read |
| 23 | + # issues: write |
| 24 | + # steps: |
| 25 | + # - uses: pelikhan/action-genai-issue-dedup@v0 |
| 26 | + # with: |
| 27 | + # github_token: ${{ secrets.GITHUB_TOKEN }} |
| 28 | + # labels: "auto" |
| 29 | + # count: "50" |
| 30 | + # since: "180d" |
| 31 | + |
| 32 | + triage: |
| 33 | + runs-on: ubuntu-latest |
| 34 | + strategy: |
| 35 | + fail-fast: false |
| 36 | + permissions: |
| 37 | + issues: write |
| 38 | + id-token: write |
| 39 | + steps: |
| 40 | + - name: Determine body and id |
| 41 | + env: |
| 42 | + ANTHROPIC_BASE_URL: ${{ secrets.ANTHROPIC_BASE_URL }} |
| 43 | + ANTHROPIC_MODEL: ${{ secrets.ANTHROPIC_MODEL }} |
| 44 | + ANTHROPIC_AUTH_TOKEN: ${{ secrets.ANTHROPIC_AUTH_TOKEN }} |
| 45 | + id: vars |
| 46 | + run: | |
| 47 | + if [ "${{ github.event_name }}" = "issues" ]; then |
| 48 | + echo "NBR=${{ github.event.issue.number }}" >> $GITHUB_ENV |
| 49 | + echo "TITLE=${{ github.event.issue.title }}" >> $GITHUB_ENV |
| 50 | + echo "BODY=${{ github.event.issue.body }}" >> $GITHUB_ENV |
| 51 | + echo "AUTHOR=${{ github.event.issue.user.login }}" >> $GITHUB_ENV |
| 52 | + elif [ "${{ github.event_name }}" = "pull_request" ]; then |
| 53 | + echo "NBR=${{ github.event.pull_request.number }}" >> $GITHUB_ENV |
| 54 | + echo "TITLE=${{ github.event.pull_request.title }}" >> $GITHUB_ENV |
| 55 | + echo "BODY=${{ github.event.pull_request.body }}" >> $GITHUB_ENV |
| 56 | + echo "AUTHOR=${{ github.event.pull_request.user.login }}" >> $GITHUB_ENV |
| 57 | + fi |
| 58 | +
|
| 59 | + - uses: anthropics/claude-code-action@v1 |
| 60 | + with: |
| 61 | + anthropic_api_key: ${{ secrets.ANTHROPIC_AUTH_TOKEN }} |
| 62 | + prompt: | |
| 63 | + REPO: ${{ github.repository }} |
| 64 | + TITLE: ${{ vars.TITLE }} |
| 65 | + BODY: ${{ vars.BODY }} |
| 66 | + ISSUE/PR NUMBER: ${{ vars.NBR }} |
| 67 | + AUTHOR: ${{ vars.AUTHOR }} |
| 68 | +
|
| 69 | + If you need more context on the project, read the LLMs documentation: ./docs/static/llms.txt |
| 70 | +
|
| 71 | + List labels for this repository: `gh label list` |
| 72 | +
|
| 73 | + Analyze this new issue and: |
| 74 | + 1. Determine if it's a bug report, feature request, or question |
| 75 | + 2. Suggest appropriate labels |
| 76 | + 3. Check if it duplicates existing issues |
| 77 | +
|
| 78 | + Based on your analysis, add the appropriate labels using: |
| 79 | + `gh issue edit [number] --add-label "label1,label2"` |
| 80 | +
|
| 81 | + If it appears to be a duplicate, post a comment mentioning the original issue. |
| 82 | +
|
| 83 | + claude_args: | |
| 84 | + --mcp-config '{"mcpServers": {"sequential-thinking": {"command": "npx", "args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]}}}' |
| 85 | + --allowedTools "mcp__sequential-thinking__sequentialthinking,Bash(gh issue:*),Bash(gh search:*),Bash(gh label list)" |
0 commit comments