From f354bfa69d9fae99a494ff6b9ef7a2c353419ccd Mon Sep 17 00:00:00 2001 From: Connor Vidlock Date: Mon, 20 Mar 2023 09:42:33 -0500 Subject: [PATCH] add new show-html-notice input --- .github/workflows/ci.yml | 1 + action.yml | 4 ++++ src/main.ts | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4adeb2..e6804e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,3 +27,4 @@ jobs: with: name: test-results path: __tests__/__results__/*.xml + show-html-notice: true diff --git a/action.yml b/action.yml index 325e2c4..6efed7c 100644 --- a/action.yml +++ b/action.yml @@ -60,6 +60,10 @@ inputs: working-directory: description: Relative path under $GITHUB_WORKSPACE where the repository was checked out required: false + show-html-notice: + description: Show the link to the html results in the form of a notice on the summary page. This was created to combat a GHA bug of not always displaying the results in the right action. + required: false + default: 'false' only-summary: description: | Allows you to generate only the summary. diff --git a/src/main.ts b/src/main.ts index d0c5a06..6852369 100644 --- a/src/main.ts +++ b/src/main.ts @@ -42,6 +42,7 @@ class TestReporter { readonly failOnError = core.getInput('fail-on-error', {required: true}) === 'true' readonly workDirInput = core.getInput('working-directory', {required: false}) readonly onlySummary = core.getInput('only-summary', {required: false}) === 'true' + readonly showHTMLNotice = core.getInput('show-html-notice', {required:false}) === 'true' readonly token = core.getInput('token', {required: true}) readonly octokit: InstanceType readonly context = getCheckRunContext() @@ -198,6 +199,10 @@ class TestReporter { core.info(`Check run create response: ${resp.status}`) core.info(`Check run URL: ${resp.data.url}`) core.info(`Check run HTML: ${resp.data.html_url}`) + if (this.showHTMLNotice) { + console.log(`::notice title=Test Results::${resp.data.html_url}`) + } + return results }