Actions18
- Branch Actions
- File Actions
- Issue Actions
- Merge Request Actions
- Pipeline Actions
- Raw API Actions
Overview
The node interacts with GitLab repositories to manage files, specifically supporting the "File" resource with operations to either get a single file or list files in a repository path. It is useful for workflows that need to retrieve file contents or browse directory structures within a GitLab project.
Typical use cases include:
- Fetching the content or metadata of a specific file at a given branch or commit.
- Listing files and folders under a specified path in a repository, optionally limiting the number of results or retrieving all files.
For example, you might use this node to:
- Retrieve the source code of
src/index.tsfrom themainbranch. - List all files under the
docs/folder on a particular commit SHA.
Properties
| Name | Meaning |
|---|---|
| File Path | The path to the file or directory in the repository, e.g., src/index.ts or docs/. |
| Reference | The Git reference such as a branch name or commit SHA to fetch the file(s) from, e.g., main. |
| Return All | Whether to return all matching files or only up to a specified limit. |
| Limit | Maximum number of files to return when not returning all (minimum 1). |
Output
The node outputs an array of JSON objects representing the requested file(s):
For the Get operation:
The output contains details about the single file requested, including its content (usually base64 encoded), encoding, file path, and other metadata as returned by the GitLab API.For the List operation:
The output is a list of files and directories under the specified path, each item containing properties like file name, type (blob/tree), path, mode, etc.
If binary data is present (e.g., file content), it will be included in the JSON output typically as encoded strings.
Dependencies
- Requires an API key credential for GitLab with access to the target project.
- The node expects configuration of the GitLab project either by numeric project ID or by owner/name combination.
- Uses internal helper functions to make authenticated requests to the GitLab API.
Troubleshooting
Common issues:
- Incorrect or missing project identification (project ID or owner/name) will cause API request failures.
- Specifying a non-existent file path or reference (branch/commit) will result in errors or empty responses.
- Limits set too low may truncate results unexpectedly if
Return Allis false.
Error messages:
"Unknown resource: file"— indicates the resource parameter was not correctly set to "file".- Errors related to invalid file paths or references usually come directly from the GitLab API; verify the inputs.
"The 'oldLine' parameter must be a non-negative number."is unrelated to file operations but may appear if parameters are mixed incorrectly.
To resolve errors, ensure:
- Correct project credentials and identifiers.
- Valid file paths and references exist in the repository.
- Parameters match the selected operation and resource.
Links and References
This summary focuses exclusively on the "File" resource with the "List" operation as requested.