name: Marvin Label Triage description: Automatically triage GitHub issues and PRs using Marvin on: issues: types: [opened] pull_request_target: types: [opened] workflow_dispatch: inputs: issue_number: description: "Issue or PR number to triage" required: true type: string concurrency: group: triage-${{ github.event.issue.number || github.event.pull_request.number || inputs.issue_number }} cancel-in-progress: false jobs: triage-issue: runs-on: ubuntu-latest timeout-minutes: 10 permissions: contents: read issues: write pull-requests: write 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": { "github": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server:sha-7aced2b" ], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${{ steps.marvin-token.outputs.token }}" } } } } EOF - name: Run Marvin for Issue Triage uses: anthropics/claude-code-action@v1 with: bot_name: "Marvin Context Protocol" prompt: ${{ steps.triage-prompt.outputs.PROMPT }} anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY_FOR_CI }} 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 settings: | { "GH_TOKEN": "${{ steps.marvin-token.outputs.token }}" }