mirror of
https://github.com/dorny/test-reporter.git
synced 2026-03-21 23:52:12 +01:00
feat: removing parameter, generating slug prefix and providing it as an output
This commit is contained in:
parent
7f0723a953
commit
08dfe2715b
4 changed files with 11 additions and 10 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import * as core from '@actions/core'
|
||||
import * as github from '@actions/github'
|
||||
import {GitHub} from '@actions/github/lib/utils'
|
||||
import {randomBytes} from 'node:crypto'
|
||||
|
||||
import {ArtifactProvider} from './input-providers/artifact-provider.js'
|
||||
import {LocalFileProvider} from './input-providers/local-file-provider.js'
|
||||
|
|
@ -49,7 +50,7 @@ class TestReporter {
|
|||
readonly workDirInput = core.getInput('working-directory', {required: false})
|
||||
readonly onlySummary = core.getInput('only-summary', {required: false}) === 'true'
|
||||
readonly useActionsSummary = core.getInput('use-actions-summary', {required: false}) === 'true'
|
||||
readonly slugPrefix = core.getInput('slug-prefix', {required: false})
|
||||
readonly slugPrefix = `tr-${randomBytes(4).toString('base64url')}-`
|
||||
readonly badgeTitle = core.getInput('badge-title', {required: false})
|
||||
readonly reportTitle = core.getInput('report-title', {required: false})
|
||||
readonly collapsed = core.getInput('collapsed', {required: false}) as 'auto' | 'always' | 'never'
|
||||
|
|
@ -145,6 +146,7 @@ class TestReporter {
|
|||
core.setOutput('failed', failed)
|
||||
core.setOutput('skipped', skipped)
|
||||
core.setOutput('time', time)
|
||||
core.setOutput('slug_prefix', this.slugPrefix)
|
||||
|
||||
if (this.failOnError && isFailed) {
|
||||
core.setFailed(`Failed test were found and 'fail-on-error' option is set to ${this.failOnError}`)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue