Fix workflow to update dependencies

Port over the fix from
https://github.com/github/codeql-action/pull/1544
and share code so these scripts don't get out of sync again.
This commit is contained in:
Henry Mercer 2023-02-24 20:04:38 +00:00
parent 237a258d2b
commit cf1855ae37
3 changed files with 20 additions and 15 deletions

View file

@ -27,12 +27,7 @@ jobs:
run: |
git fetch origin "$BRANCH" --depth=1
git checkout "origin/$BRANCH"
# When updating this, make sure to update the npm version in
# `.github/workflows/script/check-node-modules.sh` too.
sudo npm install --force -g npm@9.2.0
npm install
npm ci
npm run removeNPMAbsolutePaths
.github/workflows/script/update-node-modules.sh update
if [ ! -z "$(git status --porcelain)" ]; then
git config --global user.email "github-actions@github.com"
git config --global user.name "github-actions[bot]"