Skip to content

Commit

Permalink
Fix no commit message found
Browse files Browse the repository at this point in the history
  • Loading branch information
tiloio committed Nov 19, 2020
1 parent b28734e commit 103bf17
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const authorName = process.env.GITHUB_ACTOR;
const eventPath = process.env.GITHUB_EVENT_PATH;
const runId = process.env.GITHUB_RUN_ID;


const escapeRegex = (string) => string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');

let slackMentionMappingData = null;
Expand Down Expand Up @@ -51,7 +52,7 @@ const replaceAllMentions = (json) => {
const gitHubEvents = () => JSON.parse(fs.readFileSync(eventPath, 'utf8'));
const commitMessage = () => {
const event = gitHubEvents();
if (!event || !event.commit || !event.commit.length > 0) {
if (!event || !event.commits || !event.commits.length > 0) {
core.warning('No commit message found in Event:\n' + JSON.stringify(event));
return '[[no-commit-message-found!]]';
}
Expand Down

0 comments on commit 103bf17

Please sign in to comment.