GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation allows users to revert a specific commit in a GitLab project repository by making a POST request to the GitLab API endpoint `/api/v4/projects/{id}/repository/commits/{sha}/revert`. It is useful for developers or DevOps engineers who want to undo changes introduced by a particular commit in a project. For example, if a commit introduced a bug, this operation can revert that commit to restore the previous state of the codebase.

Use Case Examples

  1. Revert a commit by specifying the project ID and the commit SHA to undo changes made by that commit.
  2. Automate rollback of problematic commits in a CI/CD pipeline using this node.

Properties

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

Output

JSON

  • id - The ID or URL-encoded path of the project.
  • sha - The SHA hash of the commit that was reverted.
  • revertStatus - Status or result of the revert operation returned by the GitLab API.

Dependencies

  • GitLab API authentication token or credentials

Troubleshooting

  • Ensure the project ID and commit SHA are correct and exist in the GitLab repository.
  • Verify that the authentication token has sufficient permissions to revert commits in the project.
  • Check the base URL if using a self-hosted GitLab instance instead of gitlab.com.
  • Common error messages include 404 Not Found if the project or commit does not exist, and 401 Unauthorized if authentication fails.

Links

Discussion