Codeberg icon

Codeberg

Interact with the Codeberg API

File → List

AI-generated

Summary

List files in a specified directory of a Codeberg repository.

Inputs

  • Authentication — Choose the authentication method: Access Token or OAuth2.
  • Repository Owner (required) — The owner of the repository to list files for.
  • Repository Name (required) — The name of the repository to list files in.
  • Additional Fields — Optional parameters including Directory Path (directory to list; root if empty) and Ref (branch, tag, or commit to list files from).

Output shape

a list of file or directory items represented as JSON objects

Returns an array of JSON objects representing files and directories at the specified path and ref. If the directory path is empty, lists files from the repository root. The Ref parameter lets you specify a branch, tag, or commit SHA to list files from.

Examples

Example 1: List all files in the 'src/components' directory of a repository on the 'main' branch

Set Repository Owner to target owner, Repository Name to target repo, Additional Fields > Directory Path to 'src/components', and Additional Fields > Ref to 'main'.

Links

Discussion