Skip to content

Commit

Permalink
Merge pull request #9 from denis-trofimov/denis-trofimov-patch-new-line
Browse files Browse the repository at this point in the history
Convert various line breaks to the Slack's ones
  • Loading branch information
JoshCoady authored Aug 30, 2023
2 parents 8c8aef1 + 7dde611 commit 7752eae
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
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 7752eae

Please sign in to comment.