Skip to content

Commit bae8bbd

Browse files
authored
fix: check lockfile before scanning dependencies (#11)
The `scan_dependencies` command will now check for the lockfile at the beginning to ensure everything is in place for dependencies scan.
1 parent 3b530fe commit bae8bbd

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/jobs/scan_dependencies.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ parameters:
2828
2929
steps:
3030
- checkout
31+
- run:
32+
name: Check lockfile
33+
working_directory: <<parameters.pkg_json_dir>>
34+
command: <<include(scripts/check-lockfile.sh)>>
3135
- core/ensure_pkg_manager:
3236
ref: <<parameters.pkg_manager>>
3337
- run:

src/scripts/check-lockfile.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
if [ ! -f "package-lock.json" ] && [ ! -f "pnpm-lock.yaml" ]; then
4+
echo "Lockfile not found"
5+
6+
exit 1
7+
fi

0 commit comments

Comments
 (0)