INNER CODE UNIT · Python
write_text
94fzb/zrlog · shell/release/generate_trust_metadata.py:41
def write_text(path: Path, value: str) -> None:
temporary = path.with_name(path.name + ".tmp")
temporary.write_text(value, encoding="utf-8")
temporary.replace(path)
def generate(
artifact: Path,
*,
source_commit: str,
source_repository: str,
workflow_url: str,
build_timestamp: str,
) -> list[Path]:
checksum = sha256_file(artifact)
checksum_path = artifact.with_name(artifact.name + ".sha256")
sbom_path = artifact.with_name(artifact.name + ".sbom.cdx.json")
signature_path = artifact.with_name(artifact.name + ".sigstore.json")