Fixed path issues in regex strategy

This commit is contained in:
Corey Butler 2020-04-02 23:38:10 -05:00
parent dec8dcd1af
commit b30eee1686
2 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@ import core from '@actions/core'
export default class Dockerfile extends Regex {
constructor (root = null) {
root = path.join(process.env.GITHUB_WORKSPACE, root)
core.debug(fs.readdirSync(root))
if (fs.statSync(root).isDirectory()) {
root = path.join(root, 'Dockerfile')
}

View File

@ -2,8 +2,8 @@ import fs from 'fs'
import path from 'path'
export default class Regex {
constructor (root = null, pattern) {
root = path.join(process.env.GITHUB_WORKSPACE, root)
constructor (root = './', pattern) {
root = path.resolve(root)
if (fs.statSync(root).isDirectory()) {
throw new Error(`${root} is a directory. The Regex tag identification strategy requires a file.`)