Gitea icon

Gitea

Interact with Gitea via API

Actions393

Overview

This node operation allows you to create an attachment on a comment of an issue in a repository hosted on a Gitea instance. It is useful when you want to programmatically add files or other attachments to existing issue comments, for example, to provide additional context, logs, screenshots, or other relevant documents related to the discussion in the issue.

Practical examples include:

  • Automatically attaching build logs or error screenshots to issue comments created by CI/CD pipelines.
  • Adding supplementary documentation or images to issue discussions based on external triggers.
  • Enhancing issue tracking by appending relevant files directly to comments without manual uploads.

Properties

Name Meaning
Owner The owner (user or organization) of the repository where the issue comment exists.
Repo The name of the repository containing the issue comment.
Id The numeric ID of the comment to which the attachment will be added.
Name The name of the attachment file being uploaded and attached to the comment.

Output

The node outputs JSON data representing the result of the attachment creation request. This typically includes metadata about the newly created attachment such as its URL, ID, or other identifying information returned by the Gitea API.

If binary data is involved (e.g., the actual file content), it would be handled as an attachment to the comment but the output primarily focuses on the JSON response confirming the successful upload and association.

Dependencies

  • Requires access to a Gitea instance with API enabled.
  • Needs an API authentication token credential configured in n8n to authorize requests.
  • The base URL of the Gitea server must be provided in the credentials.
  • The node uses the Gitea REST API v1 endpoints to perform operations.

Troubleshooting

  • Invalid repository or owner: Ensure that the "Owner" and "Repo" values are correct and that the authenticated user has permission to access them.
  • Comment ID not found: Verify that the "Id" corresponds to an existing comment on an issue within the specified repository.
  • Attachment name missing or invalid: Provide a valid "Name" for the attachment; some characters might be restricted depending on the server.
  • Authentication errors: Check that the API key/token is valid and has sufficient permissions.
  • Network or connectivity issues: Confirm that the Gitea server URL is reachable from the n8n environment.

Common error messages usually come from the Gitea API and may indicate unauthorized access, resource not found, or validation errors on input parameters. Reviewing the API response message helps identify the exact cause.

Links and References

Discussion