Skip to content

Commit

Permalink
ci: check for unstaged files
Browse files Browse the repository at this point in the history
When you do the following
```
$ asdf install
$ npm --version
6.14.16
```

and run:

```
npm install
```

then you get a changed `package-lock.json`.

It is good practice to always check in lock files into version control.
On CI we run `npm install` (among other things). If we make sure that we
do not leave any updates files, this ensures we always commit our lock
files.
  • Loading branch information
roschaefer committed Aug 17, 2023
1 parent 4c2ef5c commit 68a00cc
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,19 @@ jobs:
- name: Update file watchers because of rails settings cached
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

- name: Read .tool-versions
uses: marocchino/tool-versions-action@v1
id: versions

- name: Use Node.js ${{ steps.versions.outputs.nodejs}}
uses: actions/setup-node@v3
with:
node-version: ${{ steps.versions.outputs.nodejs}}

- name: Install ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.0
ruby-version: ${{ steps.versions.outputs.ruby}}
bundler-cache: true

- name: Cache NPM dependencies
Expand Down Expand Up @@ -64,3 +73,9 @@ jobs:

- name: Run tests
run: bin/rake spec

- name: Check unstaged changes
run: |
git --no-pager diff --color
git update-index --refresh
git diff-index --quiet HEAD

0 comments on commit 68a00cc

Please sign in to comment.