From 8260bd8e4cdf7b70979582e89d9b227193201f7e Mon Sep 17 00:00:00 2001
From: Enno Rehling <enno.rehling@gmail.com>
Date: Fri, 17 Jun 2022 13:06:16 +0200
Subject: [PATCH] handle empty string

---
 main.js | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/main.js b/main.js
index 6732ec8..5667563 100644
--- a/main.js
+++ b/main.js
@@ -33,6 +33,7 @@ async function main() {
         const sourceRelativeDirectory = core.getInput("source_directory") || "./"
         const artifactsRelativeDirectory = core.getInput("artifacts_directory") || "./"
         const osDistribution = core.getInput("os_distribution") || ""
+        const targetReleases = core.getInput("target_releases") || ""
 
         const workspaceDirectory = process.cwd()
         const sourceDirectory = path.join(workspaceDirectory, sourceRelativeDirectory)
@@ -50,8 +51,6 @@ async function main() {
         const container = pkg
         const image = imageName + ":" + imageTag
 
-        const targetReleases = core.getInput("target_releases").split(' ') || [ imageTag ]
-
         fs.mkdirSync(artifactsDirectory, { recursive: true })
 
         core.startGroup("Print details")
@@ -136,7 +135,7 @@ async function main() {
 
         if (imageTag != "trusty") {
             core.startGroup("Install build dependencies")
-            releases = Array.prototype.concat(targetReleases.map(function (item) {
+            releases = Array.prototype.concat(targetReleases.split(" ").map(function (item) {
                 return ["-t", item]
             }))
             console.log(targetReleases)