GitLab API

GitlabTool

Actions1000

Overview

This node operation allows users to revert a specific commit in a GitLab project repository by calling the GitLab API endpoint for reverting commits. 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 or unwanted changes, this operation can revert those changes programmatically within an n8n workflow.

Use Case Examples

  1. Revert a commit in a GitLab project 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 operation.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the API request.
baseUrl The 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 API path, including the project ID and the commit SHA to revert.

Output

JSON

  • id - The ID or URL-encoded path of the project.
  • sha - The SHA of the commit that was reverted.
  • revert_commit_id - The ID of the new commit created by the revert operation.
  • message - Response message or status from the revert operation.

Dependencies

  • GitLab API authentication credential

Troubleshooting

  • Ensure the project ID and commit SHA are correctly specified and URL-encoded if necessary.
  • Verify that the GitLab API authentication credentials are valid and have sufficient permissions to revert commits.
  • Check the base URL if using a self-hosted GitLab instance to ensure it is correct.
  • Common error messages may include authentication failures, permission denied errors, or invalid commit SHA errors. Resolving these typically involves correcting credentials, permissions, or input parameters.

Links

Discussion