Gitea icon

Gitea

Interact with Gitea via API

Actions393

Overview

This node operation allows users to create tag protection rules on a repository hosted in a Gitea instance. Tag protection is useful for preventing unauthorized or accidental modifications to tags, which are often used to mark important points in the repository history such as releases.

Typical use cases include:

  • Enforcing release management policies by restricting who can create or delete tags matching certain patterns.
  • Protecting critical tags from being overwritten or deleted by mistake.
  • Automating repository governance in CI/CD pipelines by programmatically setting tag protections.

For example, a DevOps engineer might use this node to protect all tags starting with "release-" so that only specific teams or users can push those tags.

Properties

Name Meaning
Owner The owner (user or organization) of the repository where the tag protection will be set.
Repo The name of the repository to apply the tag protection rule.
Name Pattern A pattern (string) to match tag names that should be protected (e.g., "release-*").
Whitelist Teams JSON array of team names that are allowed to bypass the tag protection restrictions.
Whitelist Usernames JSON array of usernames that are allowed to bypass the tag protection restrictions.

Output

The node outputs JSON data representing the created tag protection rule as returned by the Gitea API. This typically includes details such as the ID of the protection rule, the pattern it applies to, and the whitelisted teams and users.

No binary data output is involved.

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

  • Invalid Owner or Repo: If the specified owner or repository does not exist or is misspelled, the API call will fail. Verify the spelling and existence of the repository.
  • Insufficient Permissions: The API token used must have sufficient permissions to modify repository settings. Errors related to authorization indicate missing scopes or privileges.
  • Malformed JSON for Whitelists: The whitelist properties expect valid JSON arrays. Invalid JSON syntax will cause parsing errors. Ensure the input is correctly formatted JSON.
  • Empty or Missing Required Fields: Owner and Repo are required fields; omitting them will result in errors.
  • API Endpoint Unreachable: Network issues or incorrect base URL configuration can prevent communication with the Gitea server.

Links and References

Discussion