Skip to content

Standardize on a JSON library? #109

Standardize on a JSON library?

Standardize on a JSON library? #109

name: Claude Dispatcher
on:
issue_comment:
types: [created]
issues:
types: [opened]
pull_request_review_comment:
types: [created]
pull_request_review:
types: [submitted]
jobs:
dispatch-to-monorepo:
if: |
(contains(github.event.comment.body || github.event.issue.body || github.event.review.body || '', '@claude'))
runs-on: ubuntu-latest
steps:
- name: Post initial comment
id: comment
uses: actions/github-script@v7
with:
script: |
const comment = await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: '🤖 Claude is processing your request...'
});
return comment.data.id;
- name: Dispatch to Monorepo
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.MONOREPO_DISPATCH_TOKEN || secrets.GITHUB_TOKEN }}
repository: ${{ github.repository == 'opral/monorepo' && 'opral/monorepo' || 'opral/monorepo' }}
event-type: claude-request
client-payload: |
{
"issue_number": "${{ github.event.issue.number }}",
"issue_title": ${{ toJSON(github.event.issue.title) }},
"issue_body": ${{ toJSON(github.event.issue.body) }},
"comment_body": ${{ toJSON(github.event.comment.body || github.event.review.body) }},
"issue_url": "${{ github.event.issue.html_url }}",
"repository": "${{ github.repository }}",
"sender": "${{ github.event.sender.login }}",
"comment_id": "${{ steps.comment.outputs.result }}",
"is_monorepo": "${{ github.repository == 'opral/monorepo' }}"
}