Skip to content

Commit 21e1008

Browse files
authored
fix(repo): update lock file after dependabot to use npm 11 (#1926)
1 parent 87e19a3 commit 21e1008

File tree

2 files changed

+71
-38
lines changed

2 files changed

+71
-38
lines changed

.github/workflows/fix-lockfile.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Fix Dependabot lockfile
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'package-lock.json'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
fix:
13+
if: github.actor == 'dependabot[bot]'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
ref: ${{ github.head_ref }}
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
25+
- name: Upgrade to latest
26+
run: npm install -g npm@latest
27+
28+
# This is needed to match the npm version used when publishing
29+
- name: Regenerate lockfile
30+
run: npm install --package-lock-only
31+
32+
- name: Commit fixed lockfile
33+
run: |
34+
git config user.name "github-actions[bot]"
35+
git config user.email "github-actions[bot]@users.noreply.github.com"
36+
git add package-lock.json
37+
git diff --staged --quiet || git commit -m "chore(deps): regenerate lockfile with latest npm"
38+
git push

0 commit comments

Comments
 (0)