Update main.js
This commit is contained in:
parent
e195f410a9
commit
a0b2e7a1ae
8
main.js
8
main.js
|
@ -30,7 +30,7 @@ async function main() {
|
||||||
try {
|
try {
|
||||||
const sourceRelativeDirectory = core.getInput("source_directory") || "./"
|
const sourceRelativeDirectory = core.getInput("source_directory") || "./"
|
||||||
const artifactsRelativeDirectory = core.getInput("artifacts_directory") || "./"
|
const artifactsRelativeDirectory = core.getInput("artifacts_directory") || "./"
|
||||||
const os_distribution = core.getInput("os_distribution") || ""
|
const osDistribution = core.getInput("os_distribution") || ""
|
||||||
|
|
||||||
const workspaceDirectory = process.cwd()
|
const workspaceDirectory = process.cwd()
|
||||||
const sourceDirectory = path.join(workspaceDirectory, sourceRelativeDirectory)
|
const sourceDirectory = path.join(workspaceDirectory, sourceRelativeDirectory)
|
||||||
|
@ -39,10 +39,10 @@ async function main() {
|
||||||
|
|
||||||
const file = path.join(sourceDirectory, "debian/changelog")
|
const file = path.join(sourceDirectory, "debian/changelog")
|
||||||
const changelog = await firstline(file)
|
const changelog = await firstline(file)
|
||||||
const regex = /^(?<pkg>.+) \(((?<epoch>[0-9]+):)?(?<version>[^:-]+)(-(?<revision>[^:-]+))?\) (?<package_distribution>.+);/
|
const regex = /^(?<pkg>.+) \(((?<epoch>[0-9]+):)?(?<version>[^:-]+)(-(?<revision>[^:-]+))?\) (?<packageDistribution>.+);/
|
||||||
const match = changelog.match(regex)
|
const match = changelog.match(regex)
|
||||||
const { pkg, epoch, version, revision, package_distribution } = match.groups
|
const { pkg, epoch, version, revision, packageDistribution } = match.groups
|
||||||
const distribution = os_distribution ? os_distribution : package_distribution
|
const distribution = osDistribution ? osDistribution : packageDistribution
|
||||||
const imageName = await getImageName(distribution)
|
const imageName = await getImageName(distribution)
|
||||||
const imageTag = await getImageTag(imageName, distribution)
|
const imageTag = await getImageTag(imageName, distribution)
|
||||||
const container = pkg
|
const container = pkg
|
||||||
|
|
Loading…
Reference in a new issue