diff --git a/.github/workflows/marvin-issue-triage.yml b/.github/workflows/marvin-issue-triage.yml new file mode 100644 index 000000000..d1fa4e175 --- /dev/null +++ b/.github/workflows/marvin-issue-triage.yml @@ -0,0 +1,139 @@ +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: + if: github.actor == 'strawgate' + 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 }}" + } diff --git a/.github/workflows/marvin-label-triage.yml b/.github/workflows/marvin-label-triage.yml index 8d92702d4..64d91eada 100644 --- a/.github/workflows/marvin-label-triage.yml +++ b/.github/workflows/marvin-label-triage.yml @@ -1,5 +1,6 @@ name: Marvin Label Triage -description: Automatically triage GitHub issues and PRs using Marvin +# Automatically triage GitHub issues and PRs using Marvin + on: issues: types: [opened] @@ -17,7 +18,7 @@ concurrency: cancel-in-progress: false jobs: - triage-issue: + label-issue-or-pr: runs-on: ubuntu-latest timeout-minutes: 10 permissions: @@ -123,13 +124,14 @@ jobs: PROMPT_END EOF - - name: Run Marvin for Issue Triage + - 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 }} + allowed_non_write_users: "*" # Required for issue triage workflow, if users without repo write access create issues claude_args: | --allowedTools Bash(gh label list),mcp__github__get_issue,mcp__github__get_issue_comments,mcp__github__update_issue,mcp__github__get_pull_request_files --mcp-config /tmp/mcp-config/mcp-servers.json