Establishes a multi-language monorepo structure for MCP interceptors with Python and TypeScript SDKs alongside the existing Go implementation. Implements an efficient CI/CD system that only tests what changes. #### 🏗️ SDK Scaffolding - **Python SDK** (`python/sdk/`): Modern Python package using `pyproject.toml`, aligned with official MCP Python SDK patterns - **TypeScript SDK** (`typescript/sdk/`): ESM-based package structure, compatible with official MCP TypeScript SDK - **Monorepo structure**: Consistent `{language}/sdk/` pattern across all implementations #### 🚀 CI/CD Pipeline - **Path-based workflow triggering**: Only runs CI for languages that actually changed - Change Python → only Python CI runs - Change multiple languages → only those CIs run - **Status check workflow**: Single required check that dynamically validates based on changes - **Comment triggers**: Maintainers can run all checks with `/test all` PR comment
90 lines
No EOL
2.8 KiB
YAML
90 lines
No EOL
2.8 KiB
YAML
name: Comment Trigger
|
|
|
|
on:
|
|
issue_comment:
|
|
types: [created]
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
actions: write
|
|
|
|
jobs:
|
|
trigger-checks:
|
|
name: Trigger Checks from Comment
|
|
if: |
|
|
github.event.issue.pull_request &&
|
|
(github.event.comment.body == '/test all' ||
|
|
github.event.comment.body == '/test-all' ||
|
|
github.event.comment.body == '/run-all-checks') &&
|
|
(github.event.comment.author_association == 'OWNER' ||
|
|
github.event.comment.author_association == 'MEMBER' ||
|
|
github.event.comment.author_association == 'COLLABORATOR')
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Get PR branch
|
|
uses: actions/github-script@v7
|
|
id: get-pr
|
|
with:
|
|
script: |
|
|
const pr = await github.rest.pulls.get({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
pull_number: context.issue.number
|
|
});
|
|
return pr.data.head.ref;
|
|
|
|
- name: Add reaction to comment
|
|
uses: actions/github-script@v7
|
|
with:
|
|
script: |
|
|
await github.rest.reactions.createForIssueComment({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
comment_id: context.payload.comment.id,
|
|
content: 'rocket'
|
|
});
|
|
|
|
- name: Trigger Python CI
|
|
uses: actions/github-script@v7
|
|
with:
|
|
script: |
|
|
await github.rest.actions.createWorkflowDispatch({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
workflow_id: 'python.yml',
|
|
ref: '${{ fromJSON(steps.get-pr.outputs.result) }}'
|
|
});
|
|
|
|
- name: Trigger Go CI
|
|
uses: actions/github-script@v7
|
|
with:
|
|
script: |
|
|
await github.rest.actions.createWorkflowDispatch({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
workflow_id: 'go.yml',
|
|
ref: '${{ fromJSON(steps.get-pr.outputs.result) }}'
|
|
});
|
|
|
|
- name: Trigger TypeScript CI
|
|
uses: actions/github-script@v7
|
|
with:
|
|
script: |
|
|
await github.rest.actions.createWorkflowDispatch({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
workflow_id: 'typescript.yml',
|
|
ref: '${{ fromJSON(steps.get-pr.outputs.result) }}'
|
|
});
|
|
|
|
- name: Comment on PR
|
|
uses: actions/github-script@v7
|
|
with:
|
|
script: |
|
|
await github.rest.issues.createComment({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: context.issue.number,
|
|
body: '🚀 All CI checks triggered! Check the Actions tab for progress.'
|
|
}); |