GitHub: Get Repository Content
Availability
This workflow action is available on our Business and Enterprise for Incident Management pricing plans. Please contact our Sales Team to upgrade to an account with this action.
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.
- If you have not done so already, please follow our instructions to Create an Incident Workflow.
- When the instructions prompt you to add actions , select this action.
- Enter the following Inputs and then click Save. Continue following instructions to Publish the Workflow. When the action runs, you will see the Outputs listed below.
Inputs
Field References
Fields with the {+} icon accept 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. Please see our 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 . |
| 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. |
Updated about 8 hours ago
