fix: if GITEA_TOKEN is not available does not try to set auth up

This commit is contained in:
2026-03-22 11:02:01 -03:00
parent c1bb9ee827
commit bd9e0c8a91
+1
View File
@@ -17,6 +17,7 @@ RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli
# install composer dependencies # install composer dependencies
COPY composer.json composer.lock ./ COPY composer.json composer.lock ./
RUN --mount=type=secret,id=GITEA_TOKEN \ RUN --mount=type=secret,id=GITEA_TOKEN \
test -n "${GITEA_TOKEN}" && \
export TOKEN=$(cat /run/secrets/GITEA_TOKEN) && \ export TOKEN=$(cat /run/secrets/GITEA_TOKEN) && \
composer config --global auth.http-basic.seu-gitea.com token $TOKEN && \ composer config --global auth.http-basic.seu-gitea.com token $TOKEN && \
composer install --no-dev --optimize-autoloader composer install --no-dev --optimize-autoloader