Skip to content

Commit ebf31d4

Browse files
authored
Merge pull request #21 from rust-lang/check-in-ci-if-package-lock-json-is-up-to-date
check in ci if package-lock.json is up-to-date
2 parents 805b8f3 + d4d2d62 commit ebf31d4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,22 @@ jobs:
7474
# Instead, fail if there's a security issue.
7575
advanced-security: false
7676

77+
npm-install:
78+
name: Lockfile up-to-date
79+
runs-on: ubuntu-24.04
80+
steps:
81+
- name: Checkout repository
82+
uses: actions/checkout@v4
83+
with:
84+
persist-credentials: false
85+
86+
- name: Check if package-lock.json is up-to-date
87+
run: |
88+
npm install
89+
90+
# Assert that the git diff is empty.
91+
git diff --exit-code || (echo "Git diff is not empty. Please run 'npm install' and commit the changes." && exit 1)
92+
7793
package:
7894
name: Package
7995
runs-on: ubuntu-24.04
@@ -184,6 +200,7 @@ jobs:
184200
- format
185201
- zizmor
186202
- package
203+
- npm-install
187204
- rustfmt
188205
- action-test
189206
- clippy

0 commit comments

Comments
 (0)