fix secrets filepath and resource ID
@@ -69,13 +69,13 @@ class Runner(BaseRunner):
check_name=inv_secret_map[skipped_check],
check_result={'result': CheckResult.SKIPPED,
"suppress_comment": f"Secret scan {skipped_check} is skipped"},
- file_path=file,
+ file_path=f'/{os.path.relpath(file, root_folder)}',
file_abs_path=os.path.abspath(file),
check_class="",
code_block="",
file_line_range=[0, 0],
evaluations=None,
- resource=file
+ resource=f'/{os.path.relpath(file, root_folder)}'
))
secrets.scan_file(file)
for _, secret in iter(secrets):
@@ -93,9 +93,9 @@ class Runner(BaseRunner):
check_name=secret.type,
check_result=result,
code_block=[(secret.line_number, line_text)],
- file_path=f'{secret.filename}:{secret.secret_hash}',
+ file_path=f'/{os.path.relpath(secret.filename, root_folder)}',
file_line_range=[secret.line_number, secret.line_number + 1],
- resource=secret.filename,
+ resource=secret.secret_hash,
check_class=None,
evaluations=None,
file_abs_path=os.path.abspath(secret.filename)
