Gitea icon

Gitea

Interact with Gitea via API

Actions393

Overview

This node interacts with the Gitea API to edit a repository webhook. It allows users to update the configuration of an existing webhook on a specified repository, such as changing its active status, authorization header, branch filter, events it listens to, and other config details.

Common scenarios include:

  • Modifying webhook settings after initial creation without deleting and recreating it.
  • Enabling or disabling webhooks dynamically based on workflow conditions.
  • Updating event subscriptions or filters for repository hooks to control which events trigger the webhook.

Practical example:

  • A user wants to disable a webhook temporarily during maintenance by setting "Active" to false.
  • Another use case is updating the branch filter so that the webhook only triggers on pushes to a specific branch.

Properties

Name Meaning
Owner The owner (user or organization) of the repository where the webhook exists.
Repo The name of the repository containing the webhook to edit.
Id The numeric index or ID of the webhook to be edited.
Active Boolean flag to activate or deactivate the webhook.
Authorization Header Custom authorization header value sent with webhook requests.
Branch Filter String to filter webhook triggers by branch name.
Config JSON object representing additional webhook configuration parameters.
Events JSON array specifying which repository events the webhook should listen to.

Output

The node outputs the JSON response from the Gitea API after editing the webhook. This typically includes the updated webhook object with all its properties reflecting the changes made.

If the webhook involves binary data (e.g., payloads), this node does not explicitly output binary data but focuses on the webhook metadata and configuration.

Dependencies

  • Requires an API key credential for authenticating with the Gitea instance.
  • Needs the base URL of the Gitea server configured in credentials.
  • Depends on the Gitea REST API being accessible and the user having permission to edit repository webhooks.

Troubleshooting

  • Invalid webhook ID: If the provided webhook ID does not exist, the API will return an error. Verify the correct hook ID before editing.
  • Permission errors: Insufficient permissions to edit webhooks will cause authorization failures. Ensure the API token has appropriate scopes.
  • Malformed JSON in Config or Events: Since these fields expect JSON input, invalid JSON syntax will cause parsing errors. Validate JSON format before submitting.
  • Network issues: Connectivity problems to the Gitea server will prevent API calls. Check network access and server availability.

Links and References

Discussion