diff --git a/build.sh b/build.sh index 4082a2efd..18a5645f9 100755 --- a/build.sh +++ b/build.sh @@ -317,12 +317,11 @@ fi if [ "${SHOULD_BUILD}" != "true" ]; then echo "Build skipped because sources didn't change" echo "::set-output name=skipped::true" - gh_echo "::endgroup::" exit 0 # Nothing to do -> exit else - gh_echo "::endgroup::" gh_echo "::set-output name=skipped::false" fi +gh_echo "::endgroup::" ### # Build the image @@ -346,12 +345,12 @@ DOCKER_BUILD_ARGS+=( --label "org.opencontainers.image.created=${BUILD_DATE}" --label "org.opencontainers.image.version=${PROJECT_VERSION}" ) -if [ -d ".git" ]; then +if [ -d ".git" ] && [ -z "${SKIP_GIT}" ]; then DOCKER_BUILD_ARGS+=( --label "org.opencontainers.image.revision=${GIT_REF}" ) fi -if [ -d "${NETBOX_PATH}/.git" ]; then +if [ -d "${NETBOX_PATH}/.git" ] && [ -z "${SKIP_GIT}" ]; then DOCKER_BUILD_ARGS+=( --label "netbox.git-branch=${NETBOX_GIT_BRANCH}" --label "netbox.git-ref=${NETBOX_GIT_REF}"