Skip to content

Commit

Permalink
Fix regex parsing in artifact-provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Dorner committed Feb 15, 2021
1 parent 075144b commit 064a15c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/input-providers/artifact-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ export class ArtifactProvider implements InputProvider {
readonly runId: number
) {
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.getReportName = (str: string) => {
const match = str.match(re)
Expand Down

0 comments on commit 064a15c

Please sign in to comment.