Initial durable GitHub Mastra workflow #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Send event to local Mastra loop | |
| on: | |
| issues: | |
| types: [opened, edited, labeled, reopened] | |
| issue_comment: | |
| types: [created] | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| push: | |
| jobs: | |
| enqueue: | |
| # Install a GitHub self-hosted runner on the machine that runs Mastra and | |
| # give it the custom label "local-llm". | |
| runs-on: [self-hosted, local-llm] | |
| timeout-minutes: 2 | |
| steps: | |
| - name: Deliver event to the durable local inbox | |
| env: | |
| DELIVERY_ID: ${{ github.run_id }}-${{ github.run_attempt }} | |
| EVENT_NAME: ${{ github.event_name }} | |
| EVENT_PATH: ${{ github.event_path }} | |
| run: | | |
| curl --fail-with-body --retry 3 \ | |
| -X POST http://127.0.0.1:4317/webhooks/github \ | |
| -H "content-type: application/json" \ | |
| -H "x-github-delivery: ${DELIVERY_ID}" \ | |
| -H "x-github-event: ${EVENT_NAME}" \ | |
| --data-binary "@${EVENT_PATH}" |