Gitea icon

Gitea

Interact with Gitea via API

Actions393

Overview

This node integrates with a Gitea instance to manage repositories via its API. Specifically, the "Repo Add Collaborator" operation allows users to add a collaborator to a specified repository with a defined permission level. This is useful in scenarios where teams want to programmatically manage access control on their repositories, such as automating onboarding of new team members or managing permissions based on project roles.

Practical examples:

  • Automatically adding a developer as a collaborator with write access when they join a project.
  • Granting read-only access to external auditors by adding them as collaborators with read permission.
  • Elevating a collaborator's permission to admin for repository maintenance tasks.

Properties

Name Meaning
Owner The username or organization name that owns the repository.
Repo The name of the repository to which the collaborator will be added.
Collaborator The username of the user to be added as a collaborator on the repository.
Permission The level of access granted to the collaborator. Options: Read, Write, Admin.

Output

The node outputs JSON data representing the response from the Gitea API after attempting to add the collaborator. This typically includes details about the collaborator's invitation status or confirmation of their addition with the specified permission.

No binary data output is involved in this operation.

Dependencies

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

Troubleshooting

  • Common Issues:

    • Invalid owner or repository name: Ensure the repository exists and the owner is correct.
    • Collaborator username does not exist: Verify the collaborator's username on the Gitea instance.
    • Insufficient permissions: The API token used must have rights to manage collaborators on the repository.
    • Network or connectivity issues with the Gitea server.
  • Error Messages:

    • 404 Not Found: Repository or user not found. Check the owner, repo, and collaborator values.
    • 403 Forbidden: Authentication token lacks required permissions. Use a token with admin or write access.
    • 400 Bad Request: Invalid permission value or malformed request body. Confirm permission is one of read, write, or admin.

Resolving these usually involves verifying input parameters, ensuring proper API credentials, and confirming network accessibility.

Links and References

Discussion