From 368d8db74ac38395d055711ed3f561c86717a6cf Mon Sep 17 00:00:00 2001 From: Matt Benson Date: Tue, 1 Oct 2024 16:21:56 -0500 Subject: [PATCH] code review: don't mix promise with await Signed-off-by: Matt Benson --- .../src/actions/gitlabMergeRequest.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts b/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts index 58c461c5fa..3ef66f5f6f 100644 --- a/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts +++ b/plugins/scaffolder-backend-module-gitlab/src/actions/gitlabMergeRequest.ts @@ -274,23 +274,23 @@ which uses additional API calls in order to detect whether to 'create', 'update' ); } } - const actions: Types.CommitAction[] = ctx.input.commitAction === 'skip' ? [] : ( ( await Promise.all( - fileContents.map(async file => - getFileAction( + fileContents.map(async file => { + const action = await getFileAction( { file, targetPath }, { repoID, branch: targetBranch! }, api, ctx, remoteFiles, ctx.input.commitAction, - ).then(action => ({ file, action })), - ), + ); + return { file, action }; + }), ) ).filter(o => o.action !== 'skip') as { file: SerializedFile;