GitLab API

GitlabTool

Actions905

Overview

This node operation triggers a pipeline for a specific project in GitLab using the GitLab API. It is useful for automating CI/CD workflows by programmatically starting pipelines based on a commit SHA, branch name, or tag. For example, it can be used to trigger a build pipeline on a new commit or to manually start a pipeline for testing purposes.

Use Case Examples

  1. Trigger a pipeline for project ID 18 on the 'develop' branch to automate deployment.
  2. Start a pipeline for a specific commit SHA to run tests before merging.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request.
Authentication Type of authentication used, default is GitLab API key.
baseUrl Base URL of the GitLab instance, default is https://gitlab.com.
Method HTTP method to use for the request, default is GET.
Path Parameters Parameters for the API path including project ID and reference (branch, tag, or commit SHA).

Output

JSON

  • pipeline
    • id - ID of the triggered pipeline.
    • status - Status of the triggered pipeline.
    • ref - Reference (branch, tag, or commit SHA) for which the pipeline was triggered.
    • web_url - URL to view the pipeline in GitLab.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and ref parameters are correctly set and URL-encoded if necessary.
  • Verify that the GitLab API key has sufficient permissions to trigger pipelines.
  • Check the baseUrl if using a self-hosted GitLab instance to ensure it is correct.
  • Common error: 401 Unauthorized - indicates authentication failure; verify API key and permissions.
  • Common error: 404 Not Found - indicates the project ID or ref does not exist or is inaccessible.

Links

Discussion