Warn only if one of the params is missing

This commit is contained in:
Federico Grandi
2020-03-20 16:36:34 +01:00
parent fbbcae9aa5
commit 116c918fd3

View File

@@ -17,7 +17,7 @@ function checkInputs() {
setDefault('author_name', author.name)
setDefault('author_email', author.email)
} else {
warning(`Unable to fetch author info: couldn't find ${!eventPath ? 'event path' : !require(eventPath)?.head_commit ? 'commit' : 'commit author'}.`)
if (!getInput('author_name') || !getInput('author_email')) warning(`Unable to fetch author info: couldn't find ${!eventPath ? 'event path' : !require(eventPath)?.head_commit ? 'commit' : 'commit author'}.`)
setDefault('author_name', 'Add & Commit Action')
setDefault('author_email', 'actions@github.com')
}