From fe109c0a147beee611e9179f6ed2f7c0828f9489 Mon Sep 17 00:00:00 2001 From: CJ Skillingstad Date: Wed, 8 May 2019 10:02:33 -0700 Subject: [PATCH] Remove eval and use replace instead --- src/steps/doBackportVersions.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/steps/doBackportVersions.ts b/src/steps/doBackportVersions.ts index 1c875f67..f2207776 100644 --- a/src/steps/doBackportVersions.ts +++ b/src/steps/doBackportVersions.ts @@ -180,14 +180,15 @@ function getPullRequestTitle( commits: Commit[], prTitle: string ) { - // @ts-ignore - const commitMessages = commits // eslint-disable-line @typescript-eslint/no-unused-vars + const commitMessages = commits .map(commit => commit.message) .join(' | ') .slice(0, 200); // prTitle could include baseBranch or commitMessages in template literal - return eval('`' + prTitle + '`'); + return prTitle + .replace('${baseBranch}', baseBranch) + .replace('${commitMessages}', commitMessages); } export function getPullRequestPayload(