From 145d802b175d2a53f3e7d08b44ded701ec941322 Mon Sep 17 00:00:00 2001 From: Abhishek Kadam Date: Sat, 4 Apr 2020 17:53:43 +0530 Subject: [PATCH] append commit SHA to commit msg, only if not a part of it already. (#236) * append commit SHA to commit msg, only if not a part of it already. * user provided commit message will remain unmodified. * Update src/git.ts check, if SHA exists, before appending to commit message. Co-Authored-By: James Ives * linting bug fix (from failed workflow). Co-authored-by: James Ives --- src/git.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/git.ts b/src/git.ts index 4e73570a..01e66fa7 100644 --- a/src/git.ts +++ b/src/git.ts @@ -100,11 +100,11 @@ export async function deploy(action: ActionInterface): Promise { try { hasRequiredParameters(action) - const commitMessage = `${ - !isNullOrUndefined(action.commitMessage) - ? action.commitMessage - : `Deploying to ${action.branch} from ${action.baseBranch}` - } ${process.env.GITHUB_SHA ? `@ ${process.env.GITHUB_SHA}` : ''} 🚀` + const commitMessage = !isNullOrUndefined(action.commitMessage) + ? (action.commitMessage as string) + : `Deploying to ${action.branch} from ${action.baseBranch} ${ + process.env.GITHUB_SHA ? `@ ${process.env.GITHUB_SHA}` : '' + } 🚀` /* Checks to see if the remote exists prior to deploying.