GitLab API

GitlabTool

Actions905

Overview

This node allows users to interact with the GitLab API, specifically to trigger Slack notifications via the GitLab Slack integration endpoint. It supports making HTTP requests to the GitLab API with customizable methods and paths, focusing on the operation to post to the Slack trigger endpoint. This is useful for automating Slack notifications based on GitLab events or workflows.

Use Case Examples

  1. Trigger a Slack notification in a GitLab project when a pipeline succeeds.
  2. Send custom messages to a Slack channel using GitLab's Slack integration via API calls.

Properties

Name Meaning
Skip Authentication Option to bypass authentication for the API request.
Authentication Type of authentication used for the API request, defaulting to GitLab API key.
baseUrl Base URL of the GitLab instance to which the API requests are sent.
Method HTTP method used for the API request (GET, POST, PUT, DELETE, HEAD, PATCH).
Parameter Schema Schema defining the parameters for the postApiV4SlackTrigger operation.
Request Body Schema Schema defining the request body for the postApiV4SlackTrigger operation.
Request Path API endpoint path for the Slack trigger operation, fixed to /api/v4/slack/trigger.

Output

JSON

  • response - The JSON response returned from the GitLab API after triggering the Slack notification.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the GitLab API key credential is correctly configured and has the necessary permissions to access the Slack integration endpoint.
  • Verify the baseUrl is correct and points to the appropriate GitLab instance.
  • Check that the request body matches the expected schema for the Slack trigger endpoint to avoid validation errors.
  • Common error messages may include authentication failures, invalid request body, or endpoint not found, which can be resolved by verifying credentials, request format, and API path.

Links

Discussion