Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new action-run-number to reporter #19

Merged
merged 5 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 2 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions 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 @@ -225,8 +226,7 @@ class TestReporter {
if (this.showHTMLNotice) {
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
Loading