Actions71
- Branch Actions
- File Actions
- Group Actions
- Issue Actions
- Merge Request Actions
- Pipeline Actions
- Project Actions
- Raw API Actions
- Release Actions
- Tag Actions
File → Get
AI-generatedSummary
Fetches the raw content of a file from a GitLab repository at a specific branch or commit.
Inputs
- path (required) — The relative path to the file in the repository, for example 'src/index.ts'.
- fileRef — The branch or commit SHA to retrieve the file from (defaults to 'main').
Output shape
A single JSON item containing the file's content and metadata (e.g., file content, file mode, and last commit SHA).
Returns the raw content of the file; binary files are returned as base64-encoded strings in the content field.
Examples
Example 1: Read the current contents of a README.md file from the main branch.
Path: 'README.md', File Ref: 'main'
Example 2: Retrieve a configuration file from a specific branch.
Path: 'config/settings.', File Ref: 'feature-branch'