Dolt connection exhaustion and slow mail/beads queries #4362
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: Remove needs-info on author response | |
| on: | |
| issue_comment: | |
| types: [created] | |
| pull_request_target: | |
| types: [synchronize] | |
| jobs: | |
| remove-label: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| issues: write | |
| pull-requests: write | |
| steps: | |
| - name: Remove needs-info / needs-repro on author response | |
| uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 | |
| with: | |
| script: | | |
| const labels = ['status/needs-info', 'status/needs-repro']; | |
| // Determine issue/PR number and author | |
| let number, author; | |
| if (context.eventName === 'issue_comment') { | |
| number = context.payload.issue.number; | |
| author = context.payload.issue.user.login; | |
| // Only act when the original author comments | |
| if (context.payload.comment.user.login !== author) return; | |
| } else { | |
| // pull_request_target / synchronize | |
| number = context.payload.pull_request.number; | |
| author = context.payload.pull_request.user.login; | |
| // Only act when the PR author pushes | |
| if (context.payload.sender.login !== author) return; | |
| } | |
| // Get current labels on the issue/PR | |
| const current = await github.rest.issues.listLabelsOnIssue({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: number, | |
| }); | |
| const currentNames = current.data.map(l => l.name); | |
| for (const label of labels) { | |
| if (!currentNames.includes(label)) continue; | |
| await github.rest.issues.removeLabel({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: number, | |
| name: label, | |
| }); | |
| console.log(`Removed '${label}' from #${number}`); | |
| } |