Skip to content

Commit

Permalink
Remove eval and use replace instead
Browse files Browse the repository at this point in the history
  • Loading branch information
cjskillingstad committed May 8, 2019
1 parent 0864f16 commit fe109c0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/steps/doBackportVersions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit fe109c0

Please sign in to comment.