Gitea icon

Gitea

Interact with Gitea via API

Actions393

Overview

This node interacts with a Gitea instance to retrieve the file tree of a specific repository commit. The "Get Tree" operation under the "Repository" resource fetches the directory and file structure at a given commit SHA. This is useful for scenarios where you want to explore or analyze the contents of a repository at a particular point in its history, such as generating file lists, auditing repository changes, or integrating repository data into other workflows.

Practical examples include:

  • Listing all files and directories in a repo commit to trigger further processing.
  • Recursively fetching the entire tree structure to visualize or audit repository contents.
  • Paginating through large trees to handle repositories with many files efficiently.

Properties

Name Meaning
Owner The owner (user or organization) of the repository.
Repo The name of the repository.
Sha The commit SHA (hash) identifying the specific commit whose tree you want to retrieve.
Recursive Boolean flag indicating whether to recursively list all directories and files (true) or only top-level (false).
Page Page number for paginated results; used when the tree is large and split across multiple pages.
Per Page Number of items to return per page in paginated responses.

Output

The node outputs JSON data representing the repository tree structure at the specified commit SHA. The output includes information about files and directories, such as their paths, types, and possibly other metadata returned by the Gitea API.

If the tree is large and pagination is used, the output will correspond to the requested page and number of items per page. The presence of a truncated field in the response indicates if more pages are available.

No binary data output is indicated for this operation.

Dependencies

  • Requires access to a Gitea instance with an API endpoint.
  • Needs an API authentication token or key configured in the node credentials to authorize requests.
  • The base URL for the Gitea API must be set in the credentials configuration.

Troubleshooting

  • Common issues:

    • Invalid or missing commit SHA can cause errors or empty results.
    • Incorrect owner or repository names will result in not found errors.
    • Insufficient permissions or invalid API credentials will lead to authorization errors.
    • Large trees may require proper handling of pagination parameters (page and per_page).
  • Error messages:

    • 404 Not Found: Check that the owner, repo, and SHA values are correct.
    • 401 Unauthorized: Verify that the API authentication token is valid and has necessary permissions.
    • 400 Bad Request: Ensure query parameters like recursive, page, and per_page are correctly formatted.

Links and References

Discussion