Get repository content
The GitHub Get repository content action retrieves files and folders from a GitHub repository at a specific path, branch, or commit reference. Use this read-only action to inspect code structure, documentation, or directory listings for analysis, summaries, or onboarding content generation.
Limitations
- Access can get blocked by GitHub organization OAuth App access restrictions, returning a 403 error even when credentials are correct.
Prerequisites
-
Your admin must install and configure the GitHub connector, add the GitHub actions pack under Admin > Actions, and enable this action.
-
A GitHub app must be installed on the relevant organization(s) and linked to the correct GitHub datasource in the Glean admin console.
-
You must authenticate for GitHub actions so the action can run using your GitHub identity.
Supported parameters
| Name | Type | Description |
|---|---|---|
| Owner | String | Repository owner. |
| Repository | String | Repository name. |
| File path | String | File or folder path within the repository. |
| Branch or commit | String | Branch or commit reference to read content from. |
Usage example
You want to create onboarding documentation for new contributors by examining the structure of the project's documentation directory.
Instruction to an agent:
"Show me all files in the docs/ directory of the mycompany/backend repository on the main branch."
Resulting behavior:
-
Calls Get repository content with:
-
Ownerset to "mycompany". -
Repositoryset to "backend". -
File pathset to "docs/". -
Branch or commitset to "main".
-
-
Retrieves repository content including:
-
List of files in the docs/ directory
-
File names and paths
-
File types (file vs directory)
-
File sizes
-
Download URLs for each file
-
-
Presents the directory structure to the user.
-
User can review the documentation files and decide which ones to include in the onboarding guide.
Workflow tip: Use this action to inspect repository structure before generating documentation or onboarding content. You can specify a branch or commit SHA to view content at a specific point in history. For private repositories, ensure the GitHub app has proper access permissions.