mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Build: Run npm install when package-lock.json out of date
This commit is contained in:
@@ -9,9 +9,15 @@ if [ "$GITHUB_ACTIONS" = "true" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if npm install is likely needed before proceeding
|
# Check if npm install is likely needed before proceeding
|
||||||
if [ ! -d node_modules ] || [ package-lock.json -nt node_modules/.package-lock.json ]; then
|
if [ ! -d node_modules ]; then
|
||||||
echo "Running 'npm install' because 'node_modules/.package-lock.json' appears to be outdated..."
|
echo "Running 'npm install' because 'node_modules' directory is missing."
|
||||||
|
npm install
|
||||||
|
elif [ package.json -nt package-lock.json ]; then
|
||||||
|
echo "Running 'npm install' because 'package-lock.json' appears to be outdated."
|
||||||
|
npm install
|
||||||
|
elif [ package-lock.json -nt node_modules/.package-lock.json ]; then
|
||||||
|
echo "Running 'npm install' because 'node_modules/.package-lock.json' appears to be outdated."
|
||||||
npm install
|
npm install
|
||||||
else
|
else
|
||||||
echo "Skipping 'npm install' because 'node_modules/.package-lock.json' appears to be up-to-date."
|
echo "Skipping 'npm install' because everything appears to be up-to-date."
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user