diff options
author | silverwind <me@silverwind.io> | 2022-01-15 12:06:29 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-15 21:06:29 +0100 |
commit | 0ed9b006e87c055f232f11ef5bdfff15075c36cd (patch) | |
tree | c78632a0346293d8956d4b9b25c90c2860e72946 /Makefile | |
parent | d7c2a2951c6a0a85f43675c83d3d639cd50eccb4 (diff) | |
download | gitea-0ed9b006e87c055f232f11ef5bdfff15075c36cd.tar.gz gitea-0ed9b006e87c055f232f11ef5bdfff15075c36cd.zip |
Add lockfile-check (#18285)
* Add lockfile-check
This check runs `npm install` which will rewrite the lockfile in case it
is inconsistent with package.json. This check detects this and will fail
the CI in such a case.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -292,7 +292,7 @@ fmt-check: checks: checks-frontend checks-backend .PHONY: checks-frontend -checks-frontend: svg-check +checks-frontend: lockfile-check svg-check .PHONY: checks-backend checks-backend: swagger-check swagger-validate @@ -700,6 +700,17 @@ svg-check: svg exit 1; \ fi +.PHONY: lockfile-check +lockfile-check: + npm install --package-lock-only + @diff=$$(git diff package-lock.json); \ + if [ -n "$$diff" ]; then \ + echo "package-lock.json is inconsistent with package.json"; \ + echo "Please run 'npm install --package-lock-only' and commit the result:"; \ + echo "$${diff}"; \ + exit 1; \ + fi + .PHONY: update-translations update-translations: mkdir -p ./translations |