Skip to navigation

Find Files in a Git Repository

View as MarkdownOpen in Claude

Find every file with a given name in the commit a git storage config resolves to.

Without known_hosts, returns the host’s public keys instead and reads nothing, as ssh prompts on a first connection: confirm one key’s fingerprint, then repeat the request with only that key’s known_hosts_line. This needs only the storage url.

With known_hosts, ssh_key_secret and file_name are required. It runs the same checks as creating a fileset with this storage, without creating one. A fileset created afterwards from the same branch or tag resolves it again, so if the branch has moved since, its files may differ.

Path parameters

workspacestringRequired

Request

This endpoint expects an object.
storageobjectRequired

The storage a git fileset would be created with. Leave known_hosts empty to get the host’s keys; that needs only the url.

file_namestringOptionalformat: "^[^/]+$">=1 character

A file name, without a directory, to look for anywhere under the storage path. Required with known_hosts.

Response

Successful Response
host_keyslist of objectsOptional

Set when the storage had no known_hosts: the keys the host presents, ed25519 first. Each was fetched over its own unverified connection, so confirm one key’s fingerprint and repeat the request with only that key’s known_hosts_line. The repository is not read.

revisionstringOptional

The commit SHA the storage’s revision resolved to. Unset when host_keys is set.

pathslist of stringsOptional

Paths of every file with that name, relative to the storage path. Empty when host_keys is set: the repository was not read, so an empty list then says nothing about its files.

Errors

400
Bad Request Error
422
Unprocessable Entity Error
502
Bad Gateway Error