1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

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.
This commit is contained in:
silverwind
2022-01-15 12:06:29 -08:00
committed by GitHub
parent d7c2a2951c
commit 0ed9b006e8
3 changed files with 14 additions and 1 deletions

View File

@@ -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