diff --git a/src/TestIOTriggerTestGHA.ts b/src/TestIOTriggerTestGHA.ts index bd97a5c..5541873 100644 --- a/src/TestIOTriggerTestGHA.ts +++ b/src/TestIOTriggerTestGHA.ts @@ -177,6 +177,14 @@ export class TestIOTriggerTestGHA { const commentContents = `${retrievedComment.data.body}`; if (!commentContents) Util.prepareErrorMessageAndOptionallyThrow(`Comment ${submitCommentUrl} seems to be empty`, this.errorFile); + + const triggerCommentUrl = Util.getUrlFromComment(commentContents); + if (triggerCommentUrl != undefined) { + core.setOutput("testio-create-comment-url", triggerCommentUrl); + } else { + core.setOutput("testio-create-comment-url", ""); + } + return commentContents; } diff --git a/src/retrievePayload.ts b/src/retrievePayload.ts index 3ad3930..f04a4f8 100644 --- a/src/retrievePayload.ts +++ b/src/retrievePayload.ts @@ -15,9 +15,6 @@ */ import * as github from "@actions/github"; -import * as core from "@actions/core"; -import {Util} from "./Util"; -import * as fs from "fs"; import {TestIOTriggerTestGHA} from "./TestIOTriggerTestGHA"; async function createPayload() { @@ -34,15 +31,6 @@ async function createPayload() { errorFileName ); const commentContents = await gha.retrieveCommentContent(submitCommentID, submitCommentUrl); - - // TODO move this part into gha.retrieveCommentConent - const triggerCommentUrl = Util.getUrlFromComment(commentContents); - if (triggerCommentUrl != undefined) { - core.setOutput("testio-create-comment-url", triggerCommentUrl); - } else { - core.setOutput("testio-create-comment-url", ""); - } - const prepareObject = gha.retrieveValidPrepareObjectFromComment(commentContents); const prTitle: string = await gha.retrievePrTitle(); await gha.createAndPersistTestIoPayload(prepareObject, prTitle);