Skip to content

Commit 37ab326

Browse files
committed
Trim whitespace on the first line
1 parent 1a5201c commit 37ab326

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ This means that reactions to comments will appear to be made by the user account
9191

9292
Slash commands must be placed in the first line of the comment to be interpreted as a command.
9393

94-
- The first character must be a `/`
94+
- The command must start with a `/`
9595
- The slash command extends to the last non-whitespace character on the first line
9696
- Anything after the first line is ignored and can be freely used for comments
9797

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7829,7 +7829,7 @@ async function run() {
78297829
core.debug(`Comment id: ${commentId}`);
78307830

78317831
// Check if the first line of the comment is a slash command
7832-
const firstLine = commentBody.split(/\r?\n/)[0];
7832+
const firstLine = commentBody.split(/\r?\n/)[0].trim();
78337833
if (firstLine.length < 2 || firstLine.charAt(0) != "/") {
78347834
console.debug("The first line of the comment is not a valid slash command.");
78357835
return;

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async function run() {
4545
core.debug(`Comment id: ${commentId}`);
4646

4747
// Check if the first line of the comment is a slash command
48-
const firstLine = commentBody.split(/\r?\n/)[0];
48+
const firstLine = commentBody.split(/\r?\n/)[0].trim();
4949
if (firstLine.length < 2 || firstLine.charAt(0) != "/") {
5050
console.debug("The first line of the comment is not a valid slash command.");
5151
return;

0 commit comments

Comments
 (0)