GitLab API icon

GitLab API

Gitlab

Actions880

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 CI pipeline completes.
  2. Create custom badges for projects based on specific criteria or events.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for public endpoints or testing.
Authentication Select the authentication method to use, typically an API key credential for GitLab.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, default is POST for this operation.
Path Parameters Parameters to specify the project ID or URL-encoded path for which the badge is created.

Output

JSON

  • id - The unique identifier of the created badge.
  • link_url - The URL 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 token or API key credential

Troubleshooting

  • Ensure the project ID provided in path parameters is correct and accessible by the authenticated user.
  • Verify that the authentication token has sufficient permissions to create badges on the project.
  • Check the request body schema matches the expected format for creating badges as per GitLab API documentation.
  • Common error messages include 401 Unauthorized (authentication issues), 404 Not Found (invalid project ID), and 400 Bad Request (invalid request body). Resolving these involves correcting credentials, project ID, or request payload respectively.

Links

Discussion