mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-16 06:17:10 +01:00
Fix regex parsing in artifact-provider
This commit is contained in:
parent
075144b122
commit
064a15c405
3 changed files with 9 additions and 3 deletions
5
dist/index.js
generated
vendored
5
dist/index.js
generated
vendored
|
|
@ -45,7 +45,10 @@ class ArtifactProvider {
|
||||||
this.sha = sha;
|
this.sha = sha;
|
||||||
this.runId = runId;
|
this.runId = runId;
|
||||||
if (this.artifact.startsWith('/')) {
|
if (this.artifact.startsWith('/')) {
|
||||||
const re = new RegExp(this.artifact);
|
const endIndex = this.artifact.lastIndexOf('/');
|
||||||
|
const rePattern = this.artifact.substring(1, endIndex);
|
||||||
|
const reOpts = this.artifact.substring(endIndex + 1);
|
||||||
|
const re = new RegExp(rePattern, reOpts);
|
||||||
this.artifactNameMatch = (str) => re.test(str);
|
this.artifactNameMatch = (str) => re.test(str);
|
||||||
this.getReportName = (str) => {
|
this.getReportName = (str) => {
|
||||||
const match = str.match(re);
|
const match = str.match(re);
|
||||||
|
|
|
||||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
|
|
@ -22,7 +22,10 @@ export class ArtifactProvider implements InputProvider {
|
||||||
readonly runId: number
|
readonly runId: number
|
||||||
) {
|
) {
|
||||||
if (this.artifact.startsWith('/')) {
|
if (this.artifact.startsWith('/')) {
|
||||||
const re = new RegExp(this.artifact)
|
const endIndex = this.artifact.lastIndexOf('/')
|
||||||
|
const rePattern = this.artifact.substring(1, endIndex)
|
||||||
|
const reOpts = this.artifact.substring(endIndex + 1)
|
||||||
|
const re = new RegExp(rePattern, reOpts)
|
||||||
this.artifactNameMatch = (str: string) => re.test(str)
|
this.artifactNameMatch = (str: string) => re.test(str)
|
||||||
this.getReportName = (str: string) => {
|
this.getReportName = (str: string) => {
|
||||||
const match = str.match(re)
|
const match = str.match(re)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue