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 <iam@jamesiv.es>

* linting bug fix (from failed workflow).

Co-authored-by: James Ives <iam@jamesiv.es>
This commit is contained in:
Abhishek Kadam 2020-04-04 17:53:43 +05:30 committed by GitHub
parent 97674fcf59
commit 145d802b17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,11 +100,11 @@ export async function deploy(action: ActionInterface): Promise<void> {
try { try {
hasRequiredParameters(action) hasRequiredParameters(action)
const commitMessage = `${ const commitMessage = !isNullOrUndefined(action.commitMessage)
!isNullOrUndefined(action.commitMessage) ? (action.commitMessage as string)
? action.commitMessage : `Deploying to ${action.branch} from ${action.baseBranch} ${
: `Deploying to ${action.branch} from ${action.baseBranch}` process.env.GITHUB_SHA ? `@ ${process.env.GITHUB_SHA}` : ''
} ${process.env.GITHUB_SHA ? `@ ${process.env.GITHUB_SHA}` : ''} 🚀` } 🚀`
/* /*
Checks to see if the remote exists prior to deploying. Checks to see if the remote exists prior to deploying.