# GitHub: Get Repository Content

Fetches the raw content of a specific file from a GitHub repository, such as a runbook, config file, or source code snippet.


> **Availability:** See the [Incident Workflow Actions Overview table](/workflow-actions) for the plans this workflow is available on.

## Description

Retrieve the content of a file from a GitHub repository during an incident workflow. This action fetches the raw file content, making it ideal for accessing runbooks, configuration files, or code snippets stored in your repositories.

This action enables teams to automatically retrieve critical documentation and resources during incident response:

- **Access Runbooks**: Pull incident response runbooks stored in GitHub directly into your incident workflow, ensuring responders have the latest procedures at their fingertips.
- **Reference Code**: Retrieve relevant source code files to help engineers identify the root cause of issues faster.
- **Retrieve Configuration Files**: Access configuration files, environment settings, or deployment manifests to aid in troubleshooting.

By integrating your GitHub repositories into incident workflows, you reduce context-switching and ensure teams have immediate access to the information they need to resolve incidents efficiently.

## Instructions

1. If you have not done so, follow the instructions to [Create an Incident Workflow](/ai-automation/automation/incident-workflows#create-an-incident-workflow).
2. When the instructions prompt you to [add actions](/ai-automation/automation/incident-workflows#add-actions), select **this action**.
3. Enter the following **Inputs** and click **Save**.
4. Continue following instructions to **Publish** the Workflow.
5. When the action runs, you will see the **Outputs** listed below.

## Inputs

> **Field References:** Fields with the **\{+\}** icon accept [Field References](/ai-automation/automation/incident-workflows#field-references), which can be useful for referencing incident data or outputs created in prior workflow steps. To add Field References, click **\{+\}**, or enter `{{`, and select relevant fields. Refer to the [Field References](/ai-automation/automation/incident-workflows#field-references) article for more information.

| Name | Description |
| :--- | :--- |
| Integration | Select a GitHub connection from the list. If you have not yet configured a GitHub integration, please follow our [GitHub integration guide](/ai-automation/automation/incident-workflows/workflow-integrations) . |
| Repository Owner | Enter the repository owner (organization or user). When viewing the repository on GitHub, the owner is available in the URL as `github.com/{owner}/repository`. For example, in `github.com/pagerduty/example-repo`, the owner is `pagerduty`. |
| Repository | Enter the repository name. When viewing the repository on GitHub, the name is available in the URL as `github.com/owner/{repository}`. For example, in `github.com/pagerduty/example-repo`, the repository name is `example-repo`. |
| Path to file | Enter the path to the file within the repository (e.g., `docs/runbooks/database-outage.md` or `config/production.yaml`). Use forward slashes / to separate directories. _Note_: File content will be truncated at 5MB, and files larger than 100MB are not supported by the GitHub API. |

## Outputs

| Name           | Description                                                                                                                                                                                                                                                                                                                                      |
| :------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Page Content   | The raw content of the GitHub file. This output contains the full text of the retrieved file and can be referenced in subsequent workflow actions. For example, you can post this content to a Slack channel, add it as an incident note, or include it in a notification. To reference this field in a subsequent action, use Field References. |
| Result         | Value that shows if the action was successful or not. Either "Success" or "Failed."                                                                                                                                                                                                                                                              |
| Result Summary | Brief description of what the action did or if it failed.                                                                                                                                                                                                                                                                                        |
| Error          | Brief description that is populated if the action failed.                                                                                                                                                                                                                                                                                        |
