From ae0c8188ee5055a3729e8d59cfc191c78ab906ca Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Thu, 26 Mar 2020 00:58:10 +0100 Subject: [PATCH] main: update - exit if any variable is undefined - hopefully resolve the issue with directory mounting --- main.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/main.sh b/main.sh index 02f2b6f..f8b76ac 100755 --- a/main.sh +++ b/main.sh @@ -1,11 +1,14 @@ #!/bin/sh -set -e +set -eu -directory="$PWD/${INPUT_DIRECTORY}" +directory="${INPUT_DIRECTORY:-}" os="${INPUT_OS:-"debian"}" -cd "$directory" +directory_runner="$RUNNER_WORKSPACE/$directory" +directory_container="$GITHUB_WORKSPACE/$directory" + +cd "$directory_container" package="$(dpkg-parsechangelog -S Source)" version="$(dpkg-parsechangelog -S Version)" @@ -17,8 +20,8 @@ image="$os:$distribution" docker create \ --tty \ --name "$container" \ - --volume "$directory":"$directory" \ - --workdir "$directory" \ + --volume "$directory_runner":"$directory_container" \ + --workdir "$directory_container" \ "$image" \ sleep inf @@ -40,7 +43,7 @@ docker exec \ docker exec \ "$container" \ - apt-get build-dep ./ + apt-get build-dep "$directory_container" docker exec \ "$container" \