GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation uploads attachments to a specific project's wiki in GitLab via the GitLab API. It is useful for automating the process of adding files to project wikis, such as images or documents, directly from an n8n workflow. For example, it can be used to programmatically attach diagrams or reference files to a project's wiki page during a CI/CD pipeline or documentation update process.

Use Case Examples

  1. Uploading an image file to a project's wiki to enhance documentation.
  2. Attaching a PDF guide to a project wiki automatically after a release.

Properties

Name Meaning
Skip Authentication Determines whether to skip authentication for the API request.
Authentication Specifies the authentication method to use, typically an API key credential for GitLab.
baseUrl The base URL of the GitLab instance to which the request is sent.
Method The HTTP method used for the request, here it is POST for uploading attachments.
Path Parameters Parameters included in the request path, specifically the project ID to identify the target project wiki for the attachment.

Output

JSON

  • id - The unique identifier of the uploaded attachment.
  • alt - Alternative text for the attachment, if applicable.
  • url - The URL where the uploaded attachment can be accessed.
  • markdown - Markdown formatted link to embed the attachment in wiki pages.

Dependencies

  • GitLab API authentication token or API key credential

Troubleshooting

  • Ensure the project ID path parameter is correctly set and corresponds to an existing project in GitLab.
  • Verify that the authentication token has sufficient permissions to upload attachments to the project's wiki.
  • Check the base URL to ensure it points to the correct GitLab instance, especially if using a self-hosted GitLab server.
  • Common error messages include 401 Unauthorized (authentication issues), 404 Not Found (invalid project ID or wiki not enabled), and 400 Bad Request (invalid attachment data). Resolving these involves verifying credentials, project existence, and request payload format.

Links

Discussion