Gitea icon

Gitea

Interact with Gitea via API

Actions393

Overview

This node operation allows you to create a new team within an organization on a Gitea server via its API. It is useful for managing organizational structure and permissions programmatically, especially in automated workflows where teams need to be created dynamically based on project or user requirements.

Typical use cases include:

  • Automating the setup of new projects by creating corresponding teams with predefined permissions.
  • Managing access control by assigning specific repository permissions to teams.
  • Integrating with HR or project management systems to reflect team changes automatically in Gitea.

Properties

Name Meaning
Org The name of the organization where the team will be created.
Can Create Org Repo Boolean flag indicating if the team can create repositories within the organization.
Description A textual description of the team.
Includes All Repositories Boolean flag indicating whether the team has access to all repositories in the organization.
Name The name of the team to be created (required).
Permission The permission level granted to the team; options are: Read, Write, Admin.
Units JSON array specifying the units (features) the team has access to, e.g., repo actions, issues.
Units Map JSON object mapping specific units to their permission levels, e.g., "repo.code": "read".

Output

The node outputs JSON data representing the newly created team as returned by the Gitea API. This typically includes details such as the team's ID, name, description, permission settings, and associated repositories or units.

If the API supports it, binary data output is not expected for this operation.

Dependencies

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

Troubleshooting

  • Common Issues:

    • Invalid organization name or insufficient permissions may cause API errors.
    • Malformed JSON in Units or Units Map properties can lead to request failures.
    • Missing required fields like Name or Org will prevent team creation.
  • Error Messages:

    • 401 Unauthorized: Check that the API token is valid and has sufficient rights.
    • 404 Not Found: Verify the organization name exists on the Gitea server.
    • 400 Bad Request: Ensure all required fields are correctly filled and JSON properties are well-formed.

Links and References

Discussion