From 9612d9ed7ce9f01326cc0af951ddb90f753c535c Mon Sep 17 00:00:00 2001 From: Jason O'Conal Date: Tue, 30 Aug 2022 16:43:09 +0930 Subject: [PATCH] fix: see if trimming the string works Trying to work out why we can't detect the empty line properly, seeing if `trim()` will fix the issue Version 1.0.10 Relates to SRE-225 --- package.json | 2 +- src/lint.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index bcda262..5715299 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "github-pr-linter", - "version": "1.0.9", + "version": "1.0.10", "description": "Finder's GitHub commit linter, runs as a GitHub Action", "main": "index.js", "scripts": { diff --git a/src/lint.js b/src/lint.js index 59c2f3d..824994f 100644 --- a/src/lint.js +++ b/src/lint.js @@ -33,7 +33,7 @@ module.exports = function (body, title, failureCallback, infoCallback) { // Ensure that there is a blank line before the Jira reference infoCallback('Checking PR body empty line'); - if (bodyLines[bodyLines.length - 2] !== '') { + if (bodyLines[bodyLines.length - 2].trim() !== '') { for (let i = 0; i < bodyLines.length; i++) { infoCallback('Body line ' + i + ': ' + bodyLines[i]); }