Skip to content

Commit 68b5c6a

Browse files
authored
Doug/fix new package bug (#92)
* Fix for package error when no change * Fixed ref check for unchanged packages
1 parent 1a08006 commit 68b5c6a

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
66

77
[project]
88
name = "socketsecurity"
9-
version = "2.1.12"
9+
version = "2.1.14"
1010
requires-python = ">= 3.10"
1111
license = {"file" = "LICENSE"}
1212
dependencies = [

socketsecurity/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
__author__ = 'socket.dev'
2-
__version__ = '2.1.12'
2+
__version__ = '2.1.14'

socketsecurity/core/classes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def from_diff_artifact(cls, data: dict) -> "Package":
188188
ValueError: If reference data cannot be found in DiffArtifact
189189
"""
190190
ref = None
191-
if data["diffType"] in ["added", "updated"] and data.get("head"):
191+
if data["diffType"] in ["added", "updated", "unchanged"] and data.get("head"):
192192
ref = data["head"][0]
193193
elif data["diffType"] in ["removed", "replaced"] and data.get("base"):
194194
ref = data["base"][0]

socketsecurity/socketcli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def main_code():
260260
output_handler.handle_output(diff)
261261

262262
# Handle license generation
263-
if diff is not None and config.generate_license:
263+
if diff is not None and diff.id != "no_diff_id" and config.generate_license:
264264
all_packages = {}
265265
for purl in diff.packages:
266266
package = diff.packages[purl]

0 commit comments

Comments
 (0)