GitLab API

GitlabTool

Actions1000

Overview

This node operation triggers a pipeline for a specific project in GitLab. 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 deployment pipeline after code changes are pushed to a repository.

Use Case Examples

  1. Trigger a pipeline for project ID 18 on the 'develop' branch to automate testing and deployment.
  2. Start a pipeline for a specific commit SHA to validate changes 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 - Web URL to view the triggered 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 messages include authentication failures, invalid project ID or ref, and insufficient permissions. Resolving these involves verifying credentials, parameters, and user access rights.

Links

Discussion