-
Notifications
You must be signed in to change notification settings - Fork 768
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Chris Kuchin
committed
Sep 14, 2021
1 parent
9b77ced
commit 950fbbf
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
layout: "github" | ||
page_title: "GitHub: github_repository_file" | ||
description: |- | ||
Reads files within a GitHub repository | ||
--- | ||
|
||
# github_repository_file | ||
|
||
This data source allows you to read files within a | ||
GitHub repository. | ||
|
||
|
||
## Example Usage | ||
|
||
```hcl | ||
data "github_repository_file" "foo" { | ||
repository = github_repository.foo.name | ||
branch = "main" | ||
file = ".gitignore" | ||
} | ||
``` | ||
|
||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `repository` - (Required) The repository to create the file in. | ||
|
||
* `file` - (Required) The path of the file to manage. | ||
|
||
* `branch` - (Optional) Git branch (defaults to `main`). | ||
The branch must already exist, it will not be created if it does not already exist. | ||
|
||
## Attributes Reference | ||
|
||
The following additional attributes are exported: | ||
|
||
* `content` - The file content. | ||
|
||
* `commit_sha` - The SHA of the commit that modified the file. | ||
|
||
* `sha` - The SHA blob of the file. | ||
|
||
* `commit_author` - Committer author name. | ||
|
||
* `commit_email` - Committer email address. | ||
|
||
* `commit_message` - Commit message when file was last updated. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters