diff --git a/.github/workflows/marvin-issue-triage.yml b/.github/workflows/marvin-issue-triage.yml new file mode 100644 index 000000000..4a3da4de3 --- /dev/null +++ b/.github/workflows/marvin-issue-triage.yml @@ -0,0 +1,138 @@ +name: The Martian Issue Triage + +on: + issues: + types: [opened] + workflow_dispatch: + inputs: + issue_number: + description: "Issue to triage" + required: true + type: string + +concurrency: + group: triage-issue-${{ github.event.issue.number || inputs.issue_number }} + cancel-in-progress: true + +jobs: + marvin-issue-triage: + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: read + issues: write + pull-requests: read + id-token: write + + steps: + - name: Checkout base repository + uses: actions/checkout@v5 + with: + repository: ${{ github.repository }} + ref: ${{ github.event.repository.default_branch }} + + - name: Generate Marvin App token + id: marvin-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ secrets.MARVIN_APP_ID }} + private-key: ${{ secrets.MARVIN_APP_PRIVATE_KEY }} + + - name: Set triage prompt + id: triage-prompt + run: | + cat >> $GITHUB_OUTPUT << 'EOF' + PROMPT< /tmp/mcp-config/mcp-servers.json << 'EOF' + { + "mcpServers": { + "repository-summary": { + "type": "http", + "url": "https://agents-md-generator.fastmcp.app/mcp" + }, + "code-search": { + "type": "http", + "url": "https://github-code-search.fastmcp.app/mcp" + }, + "github-research": { + "command": "uvx", + "args": [ + "github-research-mcp" + ], + "env": { + "DISABLE_SUMMARIES": true, + "GITHUB_PERSONAL_ACCESS_TOKEN": "${{ steps.marvin-token.outputs.token }}" + } + } + } + } + EOF + + - name: Run Marvin for Issue Triage + uses: anthropics/claude-code-action@v1 + with: + github_token: ${{ steps.marvin-token.outputs.token }} + bot_name: "Marvin Context Protocol" + prompt: ${{ steps.triage-prompt.outputs.PROMPT }} + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY_FOR_CI }} + claude_args: | + --model claude-sonnet-4-5-20250929 + --allowedTools WebSearch,WebFetch,mcp__repository-summary,mcp__code-search,mcp__github-research + --mcp-config /tmp/mcp-config/mcp-servers.json + settings: | + { + "GH_TOKEN": "${{ steps.marvin-token.outputs.token }}" + }