Skip to content

Commit 56bb87c

Browse files
committed
fix: remove extra newlines in workflow run details comments
1 parent cf25ce3 commit 56bb87c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export async function run() {
147147
if (existingInvalidWorkItemComment) {
148148
console.log(`Found existing invalid work item comment: ${existingInvalidWorkItemComment.id}`);
149149
const currentDateTime = new Date().toISOString().replace('T', ' ').substring(0, 19);
150-
const commentExtra = `\n\n<details>\n<summary>Workflow run details</summary>\n\n[View workflow run](${context.payload.repository?.html_url}/actions/runs/${context.runId}) - _Last ran: ${currentDateTime} UTC_</details>`;
150+
const commentExtra = `\n<details>\n<summary>Workflow run details</summary>\n\n[View workflow run](${context.payload.repository?.html_url}/actions/runs/${context.runId}) - _Last ran: ${currentDateTime} UTC_</details>`;
151151
const successCommentCombined =
152152
`${COMMENT_MARKERS.INVALID_WORK_ITEMS}\n:white_check_mark: All work items referenced in this pull request now exist in Azure DevOps.` +
153153
commentExtra;
@@ -297,7 +297,7 @@ async function checkCommitsForWorkItems(
297297
if (existingFailureComment) {
298298
console.log(`Found existing commit failure comment: ${existingFailureComment.id}`);
299299
const currentDateTime = new Date().toISOString().replace('T', ' ').substring(0, 19);
300-
const commentExtra = `\n\n<details>\n<summary>Workflow run details</summary>\n\n[View workflow run](${context.payload.repository?.html_url}/actions/runs/${context.runId}) - _Last ran: ${currentDateTime} UTC_</details>`;
300+
const commentExtra = `\n<details>\n<summary>Workflow run details</summary>\n\n[View workflow run](${context.payload.repository?.html_url}/actions/runs/${context.runId}) - _Last ran: ${currentDateTime} UTC_</details>`;
301301
const successCommentCombined =
302302
`${COMMENT_MARKERS.COMMITS_NOT_LINKED}\n:white_check_mark: All commits in this pull request are now linked to work items.` +
303303
commentExtra;
@@ -438,7 +438,7 @@ async function checkPullRequestForWorkItems(
438438
if (existingFailureComment) {
439439
console.log(`Found existing failure comment: ${existingFailureComment.id}`);
440440
const currentDateTime = new Date().toISOString().replace('T', ' ').substring(0, 19);
441-
const commentExtra = `\n\n<details>\n<summary>Workflow run details</summary>\n\n[View workflow run](${context.payload.repository?.html_url}/actions/runs/${context.runId}) - _Last ran: ${currentDateTime} UTC_</details>`;
441+
const commentExtra = `\n<details>\n<summary>Workflow run details</summary>\n\n[View workflow run](${context.payload.repository?.html_url}/actions/runs/${context.runId}) - _Last ran: ${currentDateTime} UTC_</details>`;
442442
const successCommentCombined = SUCCESS_COMMENT_TEXT + commentExtra;
443443

444444
console.log('... attempting to update the PR comment to success');
@@ -510,7 +510,7 @@ async function checkPullRequestForWorkItems(
510510
async function addOrUpdateComment(octokit, context, pullNumber, commentBody, searchText) {
511511
const { owner, repo } = context.repo;
512512
const currentDateTime = new Date().toISOString().replace('T', ' ').substring(0, 19);
513-
const commentExtra = `\n\n<details>\n<summary>Workflow run details</summary>\n\n[View workflow run](${context.payload.repository?.html_url}/actions/runs/${context.runId}) - _Last ran: ${currentDateTime} UTC_</details>`;
513+
const commentExtra = `\n<details>\n<summary>Workflow run details</summary>\n\n[View workflow run](${context.payload.repository?.html_url}/actions/runs/${context.runId}) - _Last ran: ${currentDateTime} UTC_</details>`;
514514
const commentCombined = commentBody + commentExtra;
515515

516516
// Get all comments

0 commit comments

Comments
 (0)