diff --git a/.github/workflows/update-package-lock.yaml b/.github/workflows/update-package-lock.yaml index 18e60ff5e5ca3..f99cb37f4552c 100644 --- a/.github/workflows/update-package-lock.yaml +++ b/.github/workflows/update-package-lock.yaml @@ -20,13 +20,19 @@ jobs: with: node-version: 16 - - name: Configure git and update package-lock.json + - name: Update package-lock.json and push run: | - git config user.email "typescriptbot@microsoft.com" - git config user.name "TypeScript Bot" rm package-lock.json - npm install --package-lock-only --ignore-scripts # This is a no-op if package-lock.json is present. + npm install git add -f package-lock.json - if git commit -m "Update package-lock.json"; then + + if git diff --exit-code --name-only package-lock.json; then + echo "No change." + else + npm test + npx hereby lkg + git config user.email "typescriptbot@microsoft.com" + git config user.name "TypeScript Bot" + git commit -m "Update package-lock.json" git push fi