Fix regex parsing in artifact-provider

This commit is contained in:
Michal Dorner 2021-02-15 16:15:21 +01:00
parent 075144b122
commit 064a15c405
No known key found for this signature in database
GPG key ID: 9EEE04B48DA36786
3 changed files with 9 additions and 3 deletions

5
dist/index.js generated vendored
View file

@ -45,7 +45,10 @@ class ArtifactProvider {
this.sha = sha;
this.runId = runId;
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.getReportName = (str) => {
const match = str.match(re);