diff --git a/README.md b/README.md index f2f6bf7..97d6589 100644 --- a/README.md +++ b/README.md @@ -185,6 +185,9 @@ jobs: # Defaults to false show-html-notice: 'true' + # Allows for passing through calling actions run number and attempt. When running reruns, its hard to differentiate runs. + action-run-number: '' + # Personal access token used to interact with Github API # Default: ${{ github.token }} token: '' diff --git a/action.yml b/action.yml index cdf2090..5ba216d 100644 --- a/action.yml +++ b/action.yml @@ -69,6 +69,11 @@ inputs: 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' + action-run-number: + description: | + The run number of the action that generated the test results. Passed in through calling action into reporter + required: false + default: '' only-summary: description: | Allows you to generate only the summary. diff --git a/src/main.ts b/src/main.ts index 081ad5b..b448055 100644 --- a/src/main.ts +++ b/src/main.ts @@ -47,6 +47,7 @@ class TestReporter { 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 actionRunNumber = core.getInput('action-run-number', {required: false}) readonly token = core.getInput('token', {required: true}) readonly octokit: InstanceType readonly context = getCheckRunContext() @@ -226,7 +227,7 @@ class TestReporter { core.info('*** showhtmlnotice set to true') core.exportVariable('TEST_RESULTS_URL', `${resp.data.html_url}`) core.info(`Set env var to: ${process.env.TEST_RESULTS_URL}`) - core.info(`::notice title=Test Results::${resp.data.html_url}`) + core.info(`::notice title=Test Results ${this.actionRunNumber}::${resp.data.html_url}`) } core.setOutput('url', resp.data.url) core.setOutput('url_html', resp.data.html_url)