GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation reverts a specific commit in a GitLab project repository by calling the GitLab API endpoint for reverting commits. It is useful for automating the process of undoing changes introduced by a particular commit in a project, for example, when a commit introduced a bug or unwanted changes and you want to programmatically revert it.

Use Case Examples

  1. Revert a commit in a GitLab project repository by specifying the project ID and the commit SHA to be reverted.
  2. Automate rollback of changes in a CI/CD pipeline by triggering this node to revert problematic commits.

Properties

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

Output

JSON

  • id - The ID or URL-encoded path of the project.
  • sha - The commit SHA that was reverted.
  • revert_commit - Details of the newly created revert commit returned by the API.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and commit SHA are correctly specified and URL-encoded if necessary.
  • Verify that the GitLab API key has sufficient permissions to revert commits in the project repository.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.
  • Common error messages include authentication failures, invalid project ID or commit SHA, and insufficient permissions. Resolving these involves verifying credentials, input parameters, and user permissions.

Links

Discussion