Skip to content

Commit

Permalink
Merge pull request #130 from Potafe/main
Browse files Browse the repository at this point in the history
fix: test.yml to not check SHA values
  • Loading branch information
spatil00 authored Feb 26, 2025
2 parents b8b1aa0 + 12d94cb commit 0f40ccc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jobs:
- name: Check result for SPDX tag value format
run: |
# Ignore field created since it contains a created at timestamp
diff -I"Created" merged-SBoM-shallow.spdx ${{github.workspace}}/test/spdx/output/result.spdx
diff -I"Created" -I"SHA[0-9]+:" merged-SBoM-shallow.spdx ${{github.workspace}}/test/spdx/output/result.spdx
11 changes: 3 additions & 8 deletions spdxmerge/SPDXMergeLib.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import os
import codecs
from spdxmerge.SPDX_DeepMerge import SPDX_DeepMerger
from spdxmerge.SPDX_ShallowMerge import SPDX_ShallowMerger
from spdx_tools.spdx.writer.json.json_writer import (
write_document_to_file as write_json_document,
)
from spdxmerge.SPDX_DeepMerge import SPDX_DeepMerger
from spdxmerge.SPDX_ShallowMerge import SPDX_ShallowMerger

from spdx_tools.spdx.writer.tagvalue.tagvalue_writer import (
write_document_to_file as write_tagvalue_document
)
Expand All @@ -29,15 +27,12 @@ def write_file(doc, filetype, merge_type, outpath=None):
file = f"merged-SBoM-{merge_type}.{result_filetype}"
if outpath:
file = os.path.join(outpath, file)

try:
if result_filetype == "spdx":
write_tagvalue_document(doc, file)
else:
write_json_document(doc, file, validate=True)
except Exception as e:
except (ValueError) as e:
print("Document is Invalid:", end="")
print((e.args[0]))

print("File "+file+" is generated")

0 comments on commit 0f40ccc

Please sign in to comment.