Gitea icon

Gitea

Interact with Gitea via API

Actions393

Overview

This node interacts with a Git repository hosted on a Gitea server to modify files in a repository by creating or changing them through commits. It allows users to specify file operations such as adding, updating, or deleting files within a repository branch. This is useful for automating repository maintenance tasks, batch updates, or integrating repository changes into workflows.

Common scenarios include:

  • Automatically committing configuration or documentation updates.
  • Creating new branches and committing files to them.
  • Managing multiple file changes in a single commit with custom author and committer information.
  • Automating version bumps or changelog updates.

Properties

Name Meaning
Owner The owner (user or organization) of the repository where files will be changed.
Repo The name of the repository to operate on.
Author JSON object specifying the author's identity (e.g., name, email) for the commit.
Branch Optional branch name to base the file changes on; if omitted, the default branch is used.
Committer JSON object specifying the committer's identity (e.g., name, email) for the commit.
Dates JSON object specifying commit date options for author and committer dates (e.g., GIT_AUTHOR_DATE).
Files Required JSON array describing the list of file operations (add/update/delete) to perform in the commit.
Message Optional commit message; if not provided, a default message will be generated.
New Branch Optional new branch name; if provided, a new branch is created from branch before applying changes.
Signoff Boolean flag to add a "Signed-off-by" trailer by the committer at the end of the commit message. Default is true.

Output

The node outputs JSON data representing the result of the file change operation. This typically includes details about the commit made, such as commit SHA, URL, and metadata confirming the successful application of the file changes.

If binary data is output (not indicated here), it would represent file contents or related artifacts, but this node primarily deals with JSON responses from the Gitea API.

Dependencies

  • Requires access to a Gitea instance via its REST API.
  • Needs an API authentication token or key configured in n8n credentials to authorize requests.
  • The node uses the base URL from credentials to connect to the Gitea API endpoint /api/v1.

Troubleshooting

  • Authentication errors: Ensure the API key/token credential is valid and has sufficient permissions to modify the repository.
  • Branch not found: If specifying a branch that does not exist, the operation will fail unless new_branch is set to create it.
  • Invalid file operations: The files JSON must be correctly formatted with valid file paths and operations; malformed JSON or unsupported operations will cause errors.
  • Commit message missing: While optional, providing a meaningful commit message is recommended to avoid generic defaults.
  • API rate limits or connectivity issues: Check network access to the Gitea server and API rate limits.

Links and References

Discussion