Skip to content

Commit

Permalink
fix: ensure lockfiles are files
Browse files Browse the repository at this point in the history
The change ensures that lockfiles that are not files are filtered out before processing. This change aligns with the corresponding one made in the CLI (phylum-dev/cli#1202). It is done separately here because #244 (Replace lockfile detection with `phylum status`) has not been implemented yet. Plus, this allows for a fix without changing the minimum supported CLI version.
  • Loading branch information
maxrake committed Aug 17, 2023
1 parent b5028a7 commit d33b3f5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/phylum/ci/ci_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ def filter_lockfiles(self, provided_lockfiles: List[Path]) -> Lockfiles:
LOG.warning("Provided lockfile does not exist: %s", provided_lockfile)
self.returncode = ReturnCode.LOCKFILE_FILTER
continue
if not provided_lockfile.is_file():
LOG.warning("Provided lockfile is not a file: %s", provided_lockfile)
self.returncode = ReturnCode.LOCKFILE_FILTER
continue
if not provided_lockfile.stat().st_size:
LOG.warning("Provided lockfile is an empty file: %s", provided_lockfile)
self.returncode = ReturnCode.LOCKFILE_FILTER
Expand Down

0 comments on commit d33b3f5

Please sign in to comment.