Gitea icon

Gitea

Interact with Gitea via API

Actions393

Overview

This node interacts with a Gitea instance via its API to update the name of a branch in a specified repository. It is useful when you need to rename branches programmatically, for example, to standardize branch naming conventions, correct typos, or reflect changes in project structure without manually using the Gitea web interface.

Practical examples include:

  • Renaming a feature branch after merging to follow a new naming scheme.
  • Correcting mistakenly named branches across multiple repositories.
  • Automating branch renaming as part of a CI/CD pipeline.

Properties

Name Meaning
Owner The owner (user or organization) of the repository where the branch exists.
Repo The name of the repository containing the branch to be renamed.
Branch The current name of the branch that you want to update/rename.
Name The new name to assign to the branch.

Output

The node outputs JSON data representing the updated branch information returned by the Gitea API. This typically includes details such as the branch's new name and associated commit information. The output can be used downstream in workflows to confirm the rename or trigger further actions.

No binary data output is involved.

Dependencies

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

Troubleshooting

  • Common issues:

    • Incorrect owner, repo, or branch names will cause the API call to fail.
    • Insufficient permissions or invalid API token will result in authorization errors.
    • Attempting to rename a branch to a name that already exists may cause conflicts.
  • Error messages:

    • 404 Not Found: The specified repository, owner, or branch does not exist. Verify input values.
    • 401 Unauthorized: Authentication failed. Check API token validity and permissions.
    • 409 Conflict: The new branch name already exists. Choose a different name.

Resolving these usually involves verifying inputs, ensuring proper API credentials, and confirming branch name uniqueness.

Links and References

Discussion