Skip to content

Commit

Permalink
Changes as requested by @cimnine
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasge committed Jul 13, 2022
1 parent 40ac752 commit d84e2c4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}"
Expand Down

0 comments on commit d84e2c4

Please sign in to comment.