GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation deletes a file from a GitLab project repository using the GitLab API. It is useful for automating repository management tasks such as removing outdated or unnecessary files programmatically. For example, it can be used in CI/CD pipelines to clean up files after deployment or in project maintenance workflows to manage repository content.

Use Case Examples

  1. Deleting a configuration file from a project branch after a feature is merged.
  2. Removing obsolete documentation files from a specific branch in a GitLab repository.

Properties

Name Meaning
Skip Authentication If set to true, the node will skip using authentication for the API request.
Authentication The authentication method used for the API request, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method The HTTP method used for the request, default is GET but for this operation it will be DELETE.
Query Parameters Parameters sent as query strings in the API request to specify branch, commit message, start branch, author email, and author name.
Path Parameters Parameters included in the URL path to specify the project ID and the file path to delete.

Output

JSON

  • id - The project ID or identifier used in the request.
  • file_path - The path of the file that was deleted.
  • branch - The branch where the file deletion commit was made.
  • commit_message - The commit message associated with the file deletion.
  • author_email - The email of the author who made the commit.
  • author_name - The name of the author who made the commit.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID and file path are correctly URL encoded to avoid 404 errors.
  • Verify that the branch specified exists and you have permission to commit to it to prevent authorization errors.
  • Check that the commit message is provided as it is required for the deletion commit.
  • If skipping authentication, ensure the GitLab instance allows unauthenticated API requests, otherwise authentication errors will occur.

Links

Discussion