fix: add npm install step before npm publish in release workflow#7473
fix: add npm install step before npm publish in release workflow#7473DennisOSRM merged 1 commit intomasterfrom
Conversation
The prepare script runs husky, which is a devDependency. Without running npm install first, husky won't be available and npm publish will fail. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates the monthly release GitHub Actions workflow to ensure Node.js devDependencies are present before npm publish, preventing publish failures caused by the prepare script invoking husky.
Changes:
- Add a dependency installation step before running
npm publishin the monthly release workflow.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| exit 1 | ||
| - name: Install dependencies | ||
| run: npm install |
There was a problem hiding this comment.
Using npm install here will run this repo’s install/prepare lifecycle scripts (see package.json), which can trigger node-pre-gyp install and potentially fall back to building OSRM from source. For a release/publish workflow this is slow and can fail if the prebuilt binary isn’t available yet or network is flaky. Prefer npm ci (deterministic) and consider adding --ignore-scripts so dependencies (including the husky binary) are installed without executing lifecycle scripts during the install step; npm publish can still run prepare afterwards with husky available.
| run: npm install | |
| run: npm ci --ignore-scripts |
The prepare script runs husky, which is a devDependency. Without running npm install first, husky won't be available and npm publish will fail.
This was causing npm publish to fail with 'husky: not found' errors in the release workflow.