GitLab API

GitlabTool

Actions1000

Overview

This node operation allows users to create a new badge for a specific project in GitLab by making a POST request to the GitLab API endpoint `/api/v4/projects/{id}/badges`. It is useful for automating the management of project badges, such as adding status or achievement indicators to projects programmatically.

Use Case Examples

  1. Automatically add a build status badge to a project after a successful CI pipeline.
  2. Create custom badges for projects to display metrics or achievements on project pages.

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 API request is sent.
Method The HTTP method used for the request, defaulting to POST for this operation.
Path Parameters Parameters included in the URL path, specifically the project ID or URL-encoded path identifying the project to which the badge will be added.

Output

JSON

  • id - The unique identifier of the created badge.
  • link_url - The URL that the badge links to.
  • image_url - The URL of the badge image.
  • name - The name of the badge.
  • project_id - The ID of the project to which the badge belongs.

Dependencies

  • GitLab API authentication credential

Troubleshooting

  • Ensure the project ID provided in the path parameters is correct and accessible by the authenticated user.
  • Verify that the authentication credentials are valid and have the necessary permissions to create badges on the project.
  • Check that the request body contains all required fields as per the GitLab API specification for creating badges.
  • Common error messages include 401 Unauthorized (invalid or missing authentication), 404 Not Found (project not found), and 400 Bad Request (invalid request body). Resolving these involves correcting credentials, project ID, or request payload.

Links

Discussion