Actions36
- File Actions
- Issue Actions
- Organization Actions
- Release Actions
- Repository Actions
- Review Actions
- User Actions
- Workflow Actions
File → Get
AI-generatedOverview
This node operation retrieves the data of a single file from a specified GitHub repository. It is useful for scenarios where you need to access the content of a file stored in a GitHub repository, such as fetching documentation, configuration files, or code snippets. For example, you can use this node to get the README.md file from a repository to display its content or process it further in your workflow.
Use Case Examples
- Fetching a README.md file from a GitHub repository to display its content in a dashboard.
- Retrieving a configuration file from a repository to use its settings in an automation workflow.
Properties
| Name | Meaning |
|---|---|
| Repository Owner | The owner of the GitHub repository. This can be selected from a list, provided as a URL, or entered by name. |
| Repository Name | The name of the GitHub repository. This can be selected from a list, provided as a URL, or entered by name. |
| File Path | The full path of the file within the repository to retrieve. |
| As Binary Property | Whether to set the data of the file as a binary property instead of returning the raw API response. |
| Put Output File in Field | The name of the output binary field to put the file in if 'As Binary Property' is true. |
| Additional Parameters | Additional optional parameters such as the reference (commit/branch/tag) to specify which version of the file to retrieve. |
Output
Binary
Contains the file data as binary if 'As Binary Property' is true.
JSON
content- Base64 encoded content of the file retrieved from the repository.path- The path of the file in the repository.json- The JSON representation of the file metadata and content if returned raw.
Dependencies
- GitHub API accessed via GitHub App authentication using an API key credential.
Troubleshooting
- If the file path points to a folder instead of a file, an error 'File Path is a folder, not a file.' will be thrown. Ensure the file path is correct and points to a file.
- Invalid GitHub URLs or owner/repository names will cause validation errors. Verify the input formats.
- If the specified reference (branch/tag/commit) does not exist, the API call will fail. Check the reference parameter if used.
Links
- GitHub API - Get repository content - Official GitHub API documentation for retrieving repository content including files.