Gitea icon

Gitea

Interact with Gitea via API

Actions393

Overview

This node interacts with a Gitea repository to retrieve the raw content of a specific file. It is useful when you need to programmatically access the exact contents of files stored in a Gitea repository, such as configuration files, scripts, or documentation, without any additional formatting or metadata.

Common scenarios include:

  • Automating deployment pipelines by fetching configuration or script files directly from a repository.
  • Integrating repository files into other workflows or systems that require raw file data.
  • Monitoring or auditing file changes by retrieving and comparing raw file contents over time.

For example, you might use this node to get the raw content of a README file or a YAML configuration file from a particular branch or commit in your repository.

Properties

Name Meaning
Owner The owner (user or organization) of the repository.
Repo The name of the repository from which to fetch the file.
Filepath The path to the file to retrieve, formatted as {ref}/{filepath}. If no ref is provided, the default branch is used.
Ref (Optional) The name of the commit, branch, or tag to reference. Defaults to the repository’s default branch if not specified.

Output

The node outputs the raw content of the requested file in the json output field. This content is the exact file data as stored in the repository at the specified reference, without any additional processing or metadata.

If the file is binary, the node will provide the raw binary data accordingly, allowing further processing or saving as needed.

Dependencies

  • Requires an API key credential for authenticating with the Gitea instance.
  • Needs the base URL of the Gitea server configured in the credentials.
  • Relies on the Gitea REST API endpoint /repos/{owner}/{repo}/raw/{filepath} to fetch raw file contents.

Troubleshooting

  • File Not Found: If the specified file path or reference does not exist, the node may return an error indicating the file could not be found. Verify the correctness of the owner, repo, filepath, and ref parameters.
  • Authentication Errors: Ensure that the API key credential is valid and has sufficient permissions to access the repository.
  • Invalid Reference: If the ref parameter is incorrect or points to a non-existent branch/tag/commit, the node will fail to retrieve the file. Double-check the ref value or omit it to use the default branch.
  • Network Issues: Connectivity problems with the Gitea server can cause request failures. Confirm network accessibility and correct base URL configuration.

Links and References

Discussion