GitLab API

GitlabTool

Actions1000

Overview

This node operation triggers the 'play' action on a specific job within a GitLab project. It is useful for automating the execution of CI/CD jobs in GitLab pipelines. For example, you can use this node to programmatically start a paused or manual job in a GitLab project pipeline by specifying the project ID and job ID.

Use Case Examples

  1. Trigger a manual job in a GitLab project pipeline to start deployment.
  2. Automate the execution of a specific CI job after certain conditions are met in your workflow.

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 to specify the project ID and job ID for the job to be played.

Output

JSON

  • id - The ID of the job that was played.
  • status - The status of the job after being played.
  • name - The name of the job.
  • ref - The Git reference (branch or tag) associated with the job.
  • stage - The stage of the pipeline the job belongs to.
  • created_at - Timestamp when the job was created.
  • started_at - Timestamp when the job started.
  • finished_at - Timestamp when the job finished.
  • duration - Duration of the job execution.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the project ID and job ID are correctly specified and exist in the GitLab instance.
  • Verify that the API key used for authentication has sufficient permissions to trigger jobs in the project.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.
  • Common error messages include 404 Not Found if the job or project does not exist, and 401 Unauthorized if authentication fails.

Links

Discussion