From 5717a11cef7260450936d853520c4ac78486c20b Mon Sep 17 00:00:00 2001 From: Guillaume Weber <gweber@takima.fr> Date: Thu, 7 Jul 2022 19:04:50 +0200 Subject: [PATCH] fix: prevent submit commands to generate commit on main --- .../src/recorder/utils/gitea.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/deadlock-plugins/deadlock-extension/src/recorder/utils/gitea.ts b/deadlock-plugins/deadlock-extension/src/recorder/utils/gitea.ts index c0b98092..8d82a4e5 100644 --- a/deadlock-plugins/deadlock-extension/src/recorder/utils/gitea.ts +++ b/deadlock-plugins/deadlock-extension/src/recorder/utils/gitea.ts @@ -9,6 +9,7 @@ import { queue } from 'async'; import { extensionWarn, recorderError as error, recorderLog as log } from './log'; import { clearFilesExceptGit, copyGitUserFiles } from './workdir'; import { copyFile } from 'fs/promises'; +import UserMission from '../../core/mission/model/userMission'; const { readFile } = promises; @@ -17,14 +18,16 @@ const gitQueue = queue(async (task: CallableFunction) => { }, 1); export async function commitAndPushOnQueue(gitMission: GitMission, from: 'Run' | 'Auto' | 'HttpServer') { - if (from === 'Run') { - gitQueue.push(async () => { - await mergeMaster(gitMission); - }); - } else if (gitQueue.length() == 0) { - gitQueue.push(async () => { - await commitAndPushCode(gitMission); - }); + if (!UserMission.getInstance().isReviewing()) { + if (from === 'Run') { + gitQueue.push(async () => { + await mergeMaster(gitMission); + }); + } else if (gitQueue.length() == 0) { + gitQueue.push(async () => { + await commitAndPushCode(gitMission); + }); + } } } -- GitLab