From ae51c874464f5b27aac75d3b263c54a44b432ae4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Cie=C5=9Blak?= Date: Fri, 29 Jul 2022 10:52:48 +0200 Subject: [PATCH] CI: Fail if an update to yarn.lock is needed (#1047) * CI: Fail if an update to yarn.lock is needed * Clean up the lockfile --- web/Dockerfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/web/Dockerfile b/web/Dockerfile index 90b58a5eb47..bc7122836af 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -19,7 +19,14 @@ COPY README.md packages/webapps.e/telepor[t]/package.json web-apps/packages/weba # download and install npm dependencies WORKDIR web-apps -RUN yarn install +# Install JavaScript dependencies and manually check if yarn.lock needs an update. +# Yarn v1 doesn't respect the --frozen-lockfile flag when using workspaces. +# https://github.com/yarnpkg/yarn/issues/4098 +RUN sha384sum yarn.lock > yarn-lock-sha \ + && yarn install \ + && sha384sum --check yarn-lock-sha || \ + { echo "yarn.lock needs an update; run yarn install, verify that correct dependencies were installed \ +and commit the updated version of yarn.lock"; exit 1; } # copy the rest of the files and run yarn build command COPY . .