Gitea icon

Gitea

Interact with Gitea via API

Actions393

Overview

This node interacts with a Gitea server to retrieve the contents of a repository at a specified path. Specifically, the "Repo Get Contents List" operation fetches a list of files and directories from a given repository, optionally at a specific commit, branch, or tag reference. This is useful for workflows that need to inspect repository contents, automate code analysis, or trigger actions based on repository structure.

Practical examples include:

  • Listing all files in a repository's main branch to generate documentation.
  • Fetching directory contents at a specific tag to prepare release notes.
  • Automating checks on repository structure before deployment.

Properties

Name Meaning
Owner The username or organization name that owns the repository.
Repo The name of the repository from which to list contents.
Ref (Optional) The commit SHA, branch name, or tag name to specify the version of the repository. Defaults to the repository’s default branch if not provided.

Output

The node outputs JSON data representing the contents of the specified repository path. This typically includes an array of objects where each object describes a file or directory, including properties such as name, type (file or directory), size, and possibly other metadata like download URLs or SHA hashes.

If the repository content includes binary files, the node may provide links or references to download them, but it does not output binary data directly.

Dependencies

  • Requires access to a Gitea instance via its API.
  • Needs an API authentication token configured in n8n credentials to authorize requests.
  • The base URL of the Gitea server must be set in the credentials configuration.

Troubleshooting

  • Common issues:

    • Incorrect owner or repository name will result in errors indicating the repo was not found.
    • Providing an invalid ref (commit/branch/tag) may cause the API to return a not found error.
    • Network connectivity issues or incorrect API URL can prevent successful communication.
  • Error messages:

    • 404 Not Found: Check that the owner, repo, and ref values are correct and exist.
    • 401 Unauthorized: Verify that the API authentication token is valid and has sufficient permissions.
    • Timeout or Network Errors: Ensure the Gitea server is reachable from the n8n environment.

Links and References

Discussion