Segmentation fault(core dumped) on tissue_extraction_to_bgef #36
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: "Trigger Cursor Automation" | |
| on: | |
| issues: | |
| types: [labeled] | |
| permissions: | |
| issues: write | |
| jobs: | |
| trigger: | |
| if: github.event.label.name == 'cursor-fix' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 2 | |
| steps: | |
| - name: Skip if already processed | |
| id: guard | |
| uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ secrets.GH_PAT }} | |
| script: | | |
| const comments = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| per_page: 20, | |
| }); | |
| const alreadyProcessed = comments.data.some(c => | |
| c.body.includes('## Assessment') || | |
| c.body.includes('**Short answer:**') | |
| ); | |
| if (alreadyProcessed) { | |
| console.log('Issue already processed by Cursor, skipping.'); | |
| } | |
| core.setOutput('skip', alreadyProcessed ? 'true' : 'false'); | |
| - name: Collect context and send to Cursor Webhook | |
| if: steps.guard.outputs.skip != 'true' | |
| uses: actions/github-script@v7 | |
| env: | |
| WEBHOOK_URL: ${{ secrets.CURSOR_WEBHOOK_URL }} | |
| WEBHOOK_KEY: ${{ secrets.CURSOR_WEBHOOK_KEY }} | |
| GH_PAT: ${{ secrets.GH_PAT }} | |
| with: | |
| github-token: ${{ secrets.GH_PAT }} | |
| script: | | |
| const webhookUrl = process.env.WEBHOOK_URL; | |
| const webhookKey = process.env.WEBHOOK_KEY; | |
| if (!webhookUrl || !webhookKey) { | |
| core.warning('CURSOR_WEBHOOK_URL or CURSOR_WEBHOOK_KEY not set, skipping.'); | |
| return; | |
| } | |
| const issue = context.payload.issue; | |
| const labels = issue.labels.map(l => l.name); | |
| const comments = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: issue.number, | |
| per_page: 20, | |
| }); | |
| const triageComment = comments.data.find(c => | |
| c.body.includes('AI Triage Analysis') | |
| ); | |
| const payload = { | |
| issue_number: issue.number, | |
| issue_title: issue.title, | |
| issue_body: issue.body || '(no body)', | |
| issue_url: issue.html_url, | |
| issue_author: issue.user.login, | |
| existing_labels: labels, | |
| prior_triage: triageComment ? triageComment.body : null, | |
| gh_token: process.env.GH_PAT, | |
| repo_full_name: `${context.repo.owner}/${context.repo.repo}`, | |
| }; | |
| console.log(`Sending issue #${payload.issue_number} to Cursor Webhook...`); | |
| const resp = await fetch(webhookUrl, { | |
| method: 'POST', | |
| headers: { | |
| 'Authorization': `Bearer ${webhookKey}`, | |
| 'Content-Type': 'application/json', | |
| }, | |
| body: JSON.stringify(payload), | |
| }); | |
| const body = await resp.text(); | |
| console.log(`Response: ${resp.status} ${resp.statusText}`); | |
| console.log(`Body: ${body}`); | |
| if (!resp.ok) { | |
| core.setFailed(`Webhook returned ${resp.status}: ${body}`); | |
| } |