diff --git a/app/lib/docker.js b/app/lib/docker.js index b9c767b..c177ded 100644 --- a/app/lib/docker.js +++ b/app/lib/docker.js @@ -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') } diff --git a/app/lib/regex.js b/app/lib/regex.js index c34ba90..a86d1df 100644 --- a/app/lib/regex.js +++ b/app/lib/regex.js @@ -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.`)