Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Long committed Mar 8, 2024
1 parent 9c47124 commit b9de5a8
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions entrypoint/entrypoint/orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,19 @@ def compress_encode_file(file):


def set_github_output(key, value):
if os.getenv('GITHUB_ACTIONS') == 'true':
size_in_mb = (sys.getsizeof(value)) / (1024 * 1024)
if size_in_mb > 1:
s = f"unable to set output '{key}' because it is larger than GitHub's maximum allowed file size (1MB); actual size: {size_in_mb}"
logging.warning(s)
compressed_contents = zlib.compress(s.encode())
encoded = base64.b64encode(compressed_contents).decode()
value = encoded
return os.system(f'echo "{key}={value}" >> "$GITHUB_OUTPUT"')
else:
if os.getenv('GITHUB_ACTIONS') == 'false':
return 0

size_in_mb = (sys.getsizeof(value)) / (1024 * 1024)
if size_in_mb > 1:
s = f"unable to set output '{key}' because it is larger than GitHub's maximum allowed file size (1MB); actual size: {size_in_mb}"
logging.warning(s)
compressed_contents = zlib.compress(s.encode())
encoded = base64.b64encode(compressed_contents).decode()
value = encoded

return os.system(f'echo "{key}={value}" >> "$GITHUB_OUTPUT"')


def download_install_sbomgen(sbomgen_version: str, install_dst: str) -> bool:
cpu_arch = platform.machine()
Expand Down

0 comments on commit b9de5a8

Please sign in to comment.