Description
Hello,
I have set up staticman with my own Gitub app. Staticman correctly creates a PR when a new comment is posted. However when the PR is merged, the branch is not deleted.
The GitHub app is set up to listen to Pull Request events and I can see in the Vercel logs that there is an error happening in the staticman server at the time when I press "merge PR" in Gitub. From the webserver logs I see a POST
with status 500
to /v1/webhook
with the error message
Unhandled Rejection: RequestError [HttpError]: request to https://api.github.com/repos/erikw/my-site/installation failed, reason: Client network socket disconnected before secure TLS connection was established
at /var/task/node_modules/@octokit/request/dist-node/index.js:107:11
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async GitHub._authenticate (/var/task/lib/GitHub.js:60:20)
at async /var/task/lib/GitHub.js:31:21
at async module.exports (/var/task/controllers/handlePR.js:16:18) {
status: 500,
headers: {},
request: {
method: 'GET',
url: 'https://api.github.com/repos/erikw/my-site/installation',
headers: {
accept: 'application/vnd.github.machine-man-preview+json',
'user-agent': 'octokit-request.js/5.3.1 Node.js/22.11.0 (Linux 5.10; x64)',
authorization: 'Bearer [REDACTED]'
}
}
}
Node.js process exited with exit status: 128. The logs above can help with debugging the issue.
The above request happens here in staticman: https://github.com/erikw/staticman/blob/ac5a0a0e04b679f00a3e2609c3fe2658edda14f4/lib/GitHub.js#L60
I find this quite strange as staticman is able to communitcate with the Github API to create a PR, so why does it fail on connectiong to the Github API in the staticman webhook for a PR event? Has anyone seen this problem, or have an idea of how to fix it?
Edit.
From the GitHub app advanced settings I see that it's when closing the PR that the webhook request to staticman fails (above).
