autotag/app/lib/docker.js

17 lines
453 B
JavaScript
Raw Normal View History

import Regex from './regex.js'
import path from 'path'
import fs from 'fs'
2020-04-03 11:19:41 +07:00
import core from '@actions/core'
export default class Dockerfile extends Regex {
constructor (root = null) {
root = path.join(process.env.GITHUB_WORKSPACE, root)
2020-04-03 11:19:41 +07:00
core.debug(fs.readdirSync(root))
if (fs.statSync(root).isDirectory()) {
root = path.join(root, 'Dockerfile')
}
super(root, /LABEL[\s\t]+version=[\t\s+]?[\"\']?([0-9\.]+)[\"\']?/i)
}
}