Skip to content

Commit

Permalink
Add license fetching env var (#965)
Browse files Browse the repository at this point in the history
  • Loading branch information
CTY-git authored Oct 22, 2024
1 parent 28dea88 commit 92ddaa7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion patchwork/steps/ScanDepscan/ScanDepscan.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def __init__(self, inputs: dict):
install_cdxgen()

self.language = inputs.get("language", None)
self.license = inputs.get("license", None)

def run(self) -> dict:
"""
Expand Down Expand Up @@ -117,8 +118,12 @@ def run(self) -> dict:
else:
sbom_vdr_file_name = "sbom-universal"

env = os.environ.copy()
if self.license is not None:
env["FETCH_LICENSE"] = "true"

try:
p = subprocess.run(cmd, capture_output=True, text=True, cwd=os.getcwd())
p = subprocess.run(cmd, capture_output=True, text=True, cwd=os.getcwd(), env=env)
except subprocess.CalledProcessError as e:
logger.debug("Command execution failed.")
logger.debug("stdout:\n" + e.stdout)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "patchwork-cli"
version = "0.0.70"
version = "0.0.71"
description = ""
authors = ["patched.codes"]
license = "AGPL"
Expand Down

0 comments on commit 92ddaa7

Please sign in to comment.