diff --git a/backend/src/webhook/github.ts b/backend/src/webhook/github.ts index 316a9c0d3..0c41dc728 100644 --- a/backend/src/webhook/github.ts +++ b/backend/src/webhook/github.ts @@ -1,5 +1,5 @@ // eslint-disable-next-line camelcase -import { fork } from 'child_process' +import { spawn } from 'child_process' import path from 'path' import CONFIG from '../config' @@ -18,9 +18,14 @@ export const githubWebhook = async (req: any, res: any): Promise => { console.log(payload) if (payload.ref === `refs/heads/${CONFIG.WEBHOOK_GITHUB_BRANCH}`) { - const child = fork(path.join(__dirname, '../../../deployment/bare_metal/start.sh'), [ - CONFIG.WEBHOOK_GITHUB_BRANCH, - ]) + const child = spawn( + path.join(__dirname, '../../../deployment/bare_metal/start.sh'), + [CONFIG.WEBHOOK_GITHUB_BRANCH], + { + detached: true, + stdio: ['ignore', 'ignore', 'ignore'], + }, + ) // detach process to allow killing of parent process in the update script child.unref() }