Gitea icon

Gitea

Interact with Gitea via API

Actions393

Overview

This node interacts with the Gitea API to edit a Git hook for a specific repository. It allows users to update the content of an existing Git hook identified by its ID within a given repository owned by a specified owner. This is useful in scenarios where automated workflows need to modify repository hooks programmatically, such as updating deployment scripts, notifications, or integrations triggered by repository events.

Practical examples include:

  • Updating a webhook script that triggers CI/CD pipelines.
  • Modifying notification hooks to change the payload or destination.
  • Automating repository maintenance tasks by adjusting hooks without manual intervention.

Properties

Name Meaning
Owner The username or organization name that owns the repository.
Repo The name of the repository where the Git hook exists.
Id The unique identifier of the Git hook to be edited.
Content The new content or configuration data for the Git hook. This is sent as the request body.

Output

The node outputs JSON data representing the updated Git hook after the edit operation. This typically includes details such as the hook's ID, updated content, and other metadata returned by the Gitea API.

If the node supports binary data output (not indicated here), it would represent any binary payload related to the hook, but this node primarily deals with JSON data.

Dependencies

  • Requires an active connection to a Gitea instance via its API.
  • Needs an API authentication token or key configured in n8n credentials to authorize requests.
  • The base URL for the Gitea API must be set in the credentials configuration.

Troubleshooting

  • Common issues:

    • Invalid or missing repository owner or name can cause "Not Found" errors.
    • Incorrect hook ID will result in failure to locate the hook.
    • Insufficient permissions or invalid API credentials may lead to authorization errors.
    • Malformed content data might cause the API to reject the update.
  • Error messages and resolutions:

    • 404 Not Found: Verify the owner, repo, and hook ID are correct.
    • 401 Unauthorized: Check that the API key/token is valid and has necessary permissions.
    • 400 Bad Request: Ensure the content property is correctly formatted according to Gitea API expectations.

Links and References

Discussion