Spaces:
Sleeping
Sleeping
Jeremiah Lowin commited on
Simplify action setup and add github tools (#1419)
Browse files- .github/workflows/marvin.yml +8 -47
.github/workflows/marvin.yml
CHANGED
|
@@ -13,6 +13,7 @@ permissions:
|
|
| 13 |
issues: write
|
| 14 |
pull-requests: write
|
| 15 |
discussions: write
|
|
|
|
| 16 |
id-token: write
|
| 17 |
|
| 18 |
jobs:
|
|
@@ -21,15 +22,9 @@ jobs:
|
|
| 21 |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '/marvin')) ||
|
| 22 |
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '/marvin')) ||
|
| 23 |
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '/marvin')) ||
|
| 24 |
-
(github.event_name == 'issues' &&
|
| 25 |
-
(github.event_name == 'discussion' &&
|
| 26 |
(github.event_name == 'discussion_comment' && contains(github.event.comment.body, '/marvin')) ||
|
| 27 |
-
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@Marvin Context Protocol')) ||
|
| 28 |
-
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@Marvin Context Protocol')) ||
|
| 29 |
-
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@Marvin Context Protocol')) ||
|
| 30 |
-
(github.event_name == 'issues' && (contains(github.event.issue.body, '@Marvin Context Protocol') || contains(github.event.issue.title, '@Marvin Context Protocol'))) ||
|
| 31 |
-
(github.event_name == 'discussion' && (contains(github.event.discussion.body, '@Marvin Context Protocol') || contains(github.event.discussion.title, '@Marvin Context Protocol'))) ||
|
| 32 |
-
(github.event_name == 'discussion_comment' && contains(github.event.comment.body, '@Marvin Context Protocol')) ||
|
| 33 |
(github.event_name == 'issues' && github.event.action == 'assigned' && github.event.assignee.login == 'Marvin Context Protocol') ||
|
| 34 |
(github.event_name == 'issues' && github.event.action == 'labeled' && github.event.label.name == 'marvin')
|
| 35 |
runs-on: ubuntu-latest
|
|
@@ -43,16 +38,8 @@ jobs:
|
|
| 43 |
app-id: ${{ secrets.MARVIN_APP_ID }}
|
| 44 |
private-key: ${{ secrets.MARVIN_APP_PRIVATE_KEY }}
|
| 45 |
|
| 46 |
-
#
|
| 47 |
-
|
| 48 |
-
- name: Marvin (/marvin)
|
| 49 |
-
if: |
|
| 50 |
-
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '/marvin')) ||
|
| 51 |
-
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '/marvin')) ||
|
| 52 |
-
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '/marvin')) ||
|
| 53 |
-
(github.event_name == 'issues' && (contains(github.event.issue.body, '/marvin') || contains(github.event.issue.title, '/marvin'))) ||
|
| 54 |
-
(github.event_name == 'discussion' && (contains(github.event.discussion.body, '/marvin') || contains(github.event.discussion.title, '/marvin'))) ||
|
| 55 |
-
(github.event_name == 'discussion_comment' && contains(github.event.comment.body, '/marvin'))
|
| 56 |
uses: anthropics/claude-code-action@beta
|
| 57 |
with:
|
| 58 |
github_token: ${{ steps.marvin-token.outputs.token }}
|
|
@@ -60,32 +47,6 @@ jobs:
|
|
| 60 |
mode: tag
|
| 61 |
trigger_phrase: "/marvin"
|
| 62 |
allowed_bots: "*"
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
if: |
|
| 67 |
-
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@Marvin Context Protocol')) ||
|
| 68 |
-
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@Marvin Context Protocol')) ||
|
| 69 |
-
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@Marvin Context Protocol')) ||
|
| 70 |
-
(github.event_name == 'issues' && (contains(github.event.issue.body, '@Marvin Context Protocol') || contains(github.event.issue.title, '@Marvin Context Protocol'))) ||
|
| 71 |
-
(github.event_name == 'discussion' && (contains(github.event.discussion.body, '@Marvin Context Protocol') || contains(github.event.discussion.title, '@Marvin Context Protocol'))) ||
|
| 72 |
-
(github.event_name == 'discussion_comment' && contains(github.event.comment.body, '@Marvin Context Protocol'))
|
| 73 |
-
uses: anthropics/claude-code-action@beta
|
| 74 |
-
with:
|
| 75 |
-
github_token: ${{ steps.marvin-token.outputs.token }}
|
| 76 |
-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
| 77 |
-
mode: tag
|
| 78 |
-
trigger_phrase: "@Marvin Context Protocol"
|
| 79 |
-
|
| 80 |
-
# Optional: assignment/label triggers
|
| 81 |
-
- name: Marvin (assignee/label)
|
| 82 |
-
if: |
|
| 83 |
-
(github.event_name == 'issues' && github.event.action == 'assigned' && github.event.assignee.login == 'Marvin Context Protocol') ||
|
| 84 |
-
(github.event_name == 'issues' && github.event.action == 'labeled' && github.event.label.name == 'marvin')
|
| 85 |
-
uses: anthropics/claude-code-action@beta
|
| 86 |
-
with:
|
| 87 |
-
github_token: ${{ steps.marvin-token.outputs.token }}
|
| 88 |
-
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
| 89 |
-
mode: tag
|
| 90 |
-
assignee_trigger: "Marvin Context Protocol"
|
| 91 |
-
label_trigger: "marvin"
|
|
|
|
| 13 |
issues: write
|
| 14 |
pull-requests: write
|
| 15 |
discussions: write
|
| 16 |
+
actions: read
|
| 17 |
id-token: write
|
| 18 |
|
| 19 |
jobs:
|
|
|
|
| 22 |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '/marvin')) ||
|
| 23 |
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '/marvin')) ||
|
| 24 |
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '/marvin')) ||
|
| 25 |
+
(github.event_name == 'issues' && contains(github.event.issue.body, '/marvin')) ||
|
| 26 |
+
(github.event_name == 'discussion' && contains(github.event.discussion.body, '/marvin')) ||
|
| 27 |
(github.event_name == 'discussion_comment' && contains(github.event.comment.body, '/marvin')) ||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
(github.event_name == 'issues' && github.event.action == 'assigned' && github.event.assignee.login == 'Marvin Context Protocol') ||
|
| 29 |
(github.event_name == 'issues' && github.event.action == 'labeled' && github.event.label.name == 'marvin')
|
| 30 |
runs-on: ubuntu-latest
|
|
|
|
| 38 |
app-id: ${{ secrets.MARVIN_APP_ID }}
|
| 39 |
private-key: ${{ secrets.MARVIN_APP_PRIVATE_KEY }}
|
| 40 |
|
| 41 |
+
# Marvin Assistant
|
| 42 |
+
- name: Marvin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
uses: anthropics/claude-code-action@beta
|
| 44 |
with:
|
| 45 |
github_token: ${{ steps.marvin-token.outputs.token }}
|
|
|
|
| 47 |
mode: tag
|
| 48 |
trigger_phrase: "/marvin"
|
| 49 |
allowed_bots: "*"
|
| 50 |
+
allowed_tools: "mcp__github__add_issue_comment,mcp__github__create_issue,mcp__github__get_issue,mcp__github__list_issues,mcp__github__search_issues,mcp__github__update_issue,mcp__github__update_issue_comment,mcp__github__create_pull_request,mcp__github__get_pull_request,mcp__github__get_pull_request_comments,mcp__github__get_pull_request_files,mcp__github__get_pull_request_reviews,mcp__github__get_pull_request_status,mcp__github__list_pull_requests,mcp__github__update_pull_request,mcp__github__update_pull_request_branch,mcp__github__update_pull_request_comment,mcp__github__merge_pull_request"
|
| 51 |
+
additional_permissions: |
|
| 52 |
+
actions: read
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|