File tree Expand file tree Collapse file tree 2 files changed +71
-38
lines changed
Expand file tree Collapse file tree 2 files changed +71
-38
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments