def METHOD_NAME(ctx):
    oci = ctx.file.oci
    inputs = [oci]
    if ctx.attr.repotag_file:
        inputs.append(ctx.file.repotag_file)
    output = ctx.actions.declare_file(ctx.label.name + ".sha256")
    args = [
        "sum",
        "--oci-path",
        oci.path,
        "--output",
        output.path,
    ]
    if ctx.attr.repotag_file:
        args.append("--repoimage-tag-file")
        args.append(ctx.file.repotag_file.path)
    ctx.actions.run(
        inputs = inputs,
        arguments = args,
        outputs = [output],
        executable = ctx.executable._oci_pin,
        mnemonic = "OCISum",
        progress_message = "Generating OCI sum file %{label}",
    )
    return [DefaultInfo(
        files = depset([output]),
    )]