From 5e40c180cc5e329dd15266ec0461087307e86874 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Fri, 31 May 2024 13:24:30 -0700 Subject: [PATCH] Include entrypoint in github comment --- azure-pipelines-userTests.yml | 2 +- src/postGithubComments.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/azure-pipelines-userTests.yml b/azure-pipelines-userTests.yml index e6e81c2..da93b7a 100644 --- a/azure-pipelines-userTests.yml +++ b/azure-pipelines-userTests.yml @@ -123,7 +123,7 @@ jobs: - script: | npm ci npm run build - node dist/postGithubComments ${{ parameters.REQUESTING_USER }} ${{ parameters.SOURCE_ISSUE }} ${{ parameters.STATUS_COMMENT }} ${{ parameters.DISTINCT_ID }} ${{ parameters.TOP_REPOS }} '$(Pipeline.Workspace)' '$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)&view=artifacts&type=publishedArtifacts' ${{ parameters.POST_RESULT }} ${{ parameters.REPO_COUNT }} '$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_apis/build/builds/$(Build.BuildId)/artifacts' + node dist/postGithubComments ${{ parameters.ENTRYPOINT }} ${{ parameters.REQUESTING_USER }} ${{ parameters.SOURCE_ISSUE }} ${{ parameters.STATUS_COMMENT }} ${{ parameters.DISTINCT_ID }} ${{ parameters.TOP_REPOS }} '$(Pipeline.Workspace)' '$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)&view=artifacts&type=publishedArtifacts' ${{ parameters.POST_RESULT }} ${{ parameters.REPO_COUNT }} '$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_apis/build/builds/$(Build.BuildId)/artifacts' displayName: 'Update PR comment with new errors' env: GITHUB_PAT: $(GITHUB_PAT) diff --git a/src/postGithubComments.ts b/src/postGithubComments.ts index 9c1cfe3..75c6733 100644 --- a/src/postGithubComments.ts +++ b/src/postGithubComments.ts @@ -6,12 +6,12 @@ import pu = require("./utils/packageUtils"); const { argv } = process; -if (argv.length !== 12) { - console.error(`Usage: ${path.basename(argv[0])} ${path.basename(argv[1])} `); +if (argv.length !== 13) { + console.error(`Usage: ${path.basename(argv[0])} ${path.basename(argv[1])} `); process.exit(-1); } -const [, , userToTag, prNumber, commentNumber, distinctId, isTop, resultDirPath, artifactsUri, post, repoCount, getArtifactsApi] = argv; +const [, , entrypoint, userToTag, prNumber, commentNumber, distinctId, isTop, resultDirPath, artifactsUri, post, repoCount, getArtifactsApi] = argv; const isTopReposRun = isTop.toLowerCase() === "true"; const postResult = post.toLowerCase() === "true"; @@ -76,7 +76,7 @@ const outputs = resultPaths.map(p => .replaceAll(getArtifactsApiUrlPlaceholder, getArtifactsApi)); const suiteDescription = isTopReposRun ? `top ${repoCount} repos` : "user tests"; -let header = `@${userToTag} Here are the results of running the ${suiteDescription} comparing \`${oldTscResolvedVersion}\` and \`${newTscResolvedVersion}\`: +let header = `@${userToTag} Here are the results of running the ${suiteDescription} with ${entrypoint} comparing \`${oldTscResolvedVersion}\` and \`${newTscResolvedVersion}\`: ${summary.join("\n")}`;