Skip to content

Commit

Permalink
add new action-run-number to reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
cviddy committed Nov 11, 2024
1 parent ffc3bcb commit 0990522
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: ''
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof GitHub>
readonly context = getCheckRunContext()
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0990522

Please sign in to comment.