Skip to content

Commit

Permalink
fix: Convert the line breaks to Slack \n
Browse files Browse the repository at this point in the history
Signed-off-by: Denis Trofimov <[email protected]>
  • Loading branch information
denis-trofimov committed May 25, 2023
1 parent a8f8566 commit 7dde611
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ const core = require('@actions/core');
const slackifyMarkdown = require('slackify-markdown');

try {
const md = core.getInput('text', {required: true});
const mrkdwn = slackifyMarkdown(md);
core.setOutput("text", mrkdwn);
const input = core.getInput('text', { required: true });
const mrkdwn = slackifyMarkdown(input);
const output = mrkdwn.replace(/\r\n|\r|\n/g, "\\n");
core.setOutput("text", output);
} catch (error) {
core.setFailed(error.message);
}

0 comments on commit 7dde611

Please sign in to comment.