Gitea icon

Gitea

Interact with Gitea via API

Actions393

Overview

This node operation allows you to create an attachment on a specific issue within a repository hosted on a Gitea instance. It is useful when you want to programmatically add files or attachments to issues for better context, documentation, or collaboration directly from your n8n workflows.

Practical examples include:

  • Automatically attaching logs or screenshots to bug reports created in Gitea.
  • Adding generated reports or documents as attachments to issues during automated testing or deployment pipelines.
  • Enhancing issue tracking by appending relevant files without manual intervention.

Properties

Name Meaning
Owner The owner of the repository where the issue exists.
Repo The name of the repository containing the issue.
Index The index (number) of the issue to which the attachment will be added.
Name The name of the attachment file being uploaded and attached to the issue.

Output

The node outputs JSON data representing the response from the Gitea API after creating the issue attachment. This typically includes metadata about the newly created attachment such as its ID, URL, name, and other related information.

If binary data is involved (e.g., the actual file content), it would be handled as part of the attachment upload process but is not explicitly detailed in the provided code snippet.

Dependencies

  • Requires access to a Gitea instance with API enabled.
  • Needs an API authentication token configured in n8n credentials to authorize requests.
  • The base URL for the Gitea API must be set in the credentials configuration.
  • Uses the Gitea REST API endpoint for issue attachments.

Troubleshooting

  • Common Issues:

    • Incorrect repository owner or repo name can cause "Not Found" errors.
    • Invalid issue index (non-existent issue number) will result in failure to attach.
    • Missing or invalid API credentials will cause authentication errors.
    • Attachment name conflicts or invalid file formats might be rejected by the API.
  • Error Messages:

    • 401 Unauthorized: Check that the API key/token is valid and has sufficient permissions.
    • 404 Not Found: Verify the owner, repo, and issue index are correct.
    • 400 Bad Request: Ensure the attachment name and file data meet API requirements.

Links and References

Discussion