From 187a98c6b08b270eebe8ed0b9a390483ed0f52a1 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Fri, 5 Jul 2024 10:46:34 +0200 Subject: [PATCH] Improve docker labels and move safe git dir to entrypoint --- docker/Dockerfile | 18 ++++++++++++++++-- docker/entrypoint.sh | 5 ++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 488cf69..256070b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -14,7 +14,6 @@ COPY --from=composer:2 /usr/bin/composer /usr/bin/composer RUN apk add --no-cache --update git && \ git --version && \ composer --version && \ - git config --global --add safe.directory /github/workspace && \ COMPOSER_BIN_DIR="/usr/bin" composer global require --no-cache scrutinizer/ocular:${RELEASE_VERSION} && \ composer global show scrutinizer/ocular 2>/dev/null && \ RELEASE_VERSION="$(php -r "require_once '/root/.composer/vendor/autoload.php';echo \Composer\InstalledVersions::getVersion('scrutinizer/ocular');")" && \ @@ -34,6 +33,21 @@ LABEL org.label-schema.vendor="Sudo-Bot" \ org.label-schema.vcs-url="https://github.com/sudo-bot/action-scrutinizer.git" \ org.label-schema.vcs-ref=${VCS_REF} \ org.label-schema.build-date=${BUILD_DATE} \ - org.label-schema.docker.schema-version="1.0" + org.label-schema.docker.schema-version="1.0" \ + \ + com.docker.extension.publisher-url="https://github.com/wdes" \ + \ + org.opencontainers.image.title="Scrutinizer coverage action" \ + org.opencontainers.image.description="Scrutinizer coverage action for GitHub actions" \ + org.opencontainers.image.authors="williamdes@wdes.fr" \ + org.opencontainers.image.url="https://github.com/sudo-bot/action-scrutinizer#readme" \ + org.opencontainers.image.documentation="https://github.com/sudo-bot/action-scrutinizer#readme" \ + org.opencontainers.image.source="https://github.com/sudo-bot/action-scrutinizer" \ + org.opencontainers.image.vendor="Sudo-Bot" \ + org.opencontainers.image.licenses="MPL-2.0" \ + org.opencontainers.image.created=${BUILD_DATE} \ + org.opencontainers.image.version=${RELEASE_VERSION} \ + org.opencontainers.image.revision=${VCS_REF} \ + org.opencontainers.image.ref.name="latest" ENTRYPOINT ["/entrypoint.sh"] diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 97f0a82..e18fc20 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,13 +1,16 @@ #!/bin/sh -l + ## # @license http://unlicense.org/UNLICENSE The UNLICENSE # @author William Desportes ## -set -e +set -eu CLI_ARGS="$1" echo "::debug CLI_ARGS: ${CLI_ARGS}" +git config --global --add safe.directory $PWD + ocular code-coverage:upload ${CLI_ARGS}