mirror of
https://github.com/ButlerLogic/action-autotag.git
synced 2024-11-23 08:41:07 +07:00
16 lines
384 B
JavaScript
16 lines
384 B
JavaScript
|
import Regex from './regex.js'
|
||
|
import path from 'path'
|
||
|
import fs from 'fs'
|
||
|
|
||
|
export default class Dockerfile extends Regex {
|
||
|
constructor (root = null) {
|
||
|
root = path.join(process.env.GITHUB_WORKSPACE, root)
|
||
|
|
||
|
if (fs.statSync(root).isDirectory()) {
|
||
|
root = path.join(root, 'Dockerfile')
|
||
|
}
|
||
|
|
||
|
super(root, /LABEL[\s\t]+version=[\t\s+]?[\"\']?([0-9\.]+)[\"\']?/i)
|
||
|
}
|
||
|
}
|