Skip to content

Commit a48d02b

Browse files
committed
chore(data_source_github_release_asset): adjust file contents attributes
Per code review feedback from @stevehipwell, this changes `download_file`/`file` to `download_file_contents`/`file_contents`, respectively: #2514 (comment) Signed-off-by: Mike Ball <mikedball@gmail.com>
1 parent fadad7d commit a48d02b

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

github/data_source_github_release_asset.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ func dataSourceGithubReleaseAsset() *schema.Resource {
3333
Required: true,
3434
Description: "Name of the repository to retrieve the release asset from",
3535
},
36-
"download_file": {
36+
"download_file_contents": {
3737
Type: schema.TypeBool,
3838
Optional: true,
3939
Default: false,
40-
Description: "Whether to download the asset content into the file attribute",
40+
Description: "Whether to download the asset file content into the `file_contents` attribute",
4141
},
42-
"file": {
42+
"file_contents": {
4343
Type: schema.TypeString,
4444
Computed: true,
45-
Description: "The base64-encoded release asset file contents (requires `download_file` to be `true`",
45+
Description: "The base64-encoded release asset file contents (requires `download_file_contents` to be `true`)",
4646
},
4747
"url": {
4848
Type: schema.TypeString,
@@ -135,7 +135,7 @@ func dataSourceGithubReleaseAssetRead(ctx context.Context, d *schema.ResourceDat
135135
return diag.FromErr(err)
136136
}
137137

138-
if !d.Get("download_file").(bool) {
138+
if !d.Get("download_file_contents").(bool) {
139139
return nil
140140
}
141141

@@ -177,7 +177,7 @@ func dataSourceGithubReleaseAssetRead(ctx context.Context, d *schema.ResourceDat
177177
}
178178
}
179179

180-
if err := d.Set("file", buf.String()); err != nil {
180+
if err := d.Set("file_contents", buf.String()); err != nil {
181181
return diag.FromErr(err)
182182
}
183183

github/data_source_github_release_asset_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func TestAccGithubReleaseAssetDataSource(t *testing.T) {
2323
repository = "%s"
2424
owner = "%s"
2525
asset_id = "%s"
26-
download_file = true
26+
download_file_contents = true
2727
}
2828
`, testReleaseRepository, testRepositoryOwner, testReleaseAssetID)
2929

@@ -40,7 +40,7 @@ func TestAccGithubReleaseAssetDataSource(t *testing.T) {
4040
"data.github_release_asset.test", "name", testReleaseAssetName,
4141
),
4242
resource.TestCheckResourceAttr(
43-
"data.github_release_asset.test", "file", base64EncodedAssetContent,
43+
"data.github_release_asset.test", "file_contents", base64EncodedAssetContent,
4444
),
4545
),
4646
},

website/docs/d/release_asset.html.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ data "github_release_asset" "example" {
7171
* `repository` - (Required) Name of the repository to retrieve the release from
7272
* `owner` - (Required) Owner of the repository
7373
* `asset_id` - (Required) ID of the release asset to retrieve
74-
* `download_file` - (Optional) Whether to download the asset content into the file attribute. Defaults to `false`.
74+
* `download_file_contents` - (Optional) Whether to download the asset file content into the `file_contents` attribute (defaults to `false`)
7575

7676
## Attributes Reference
7777

@@ -85,4 +85,4 @@ data "github_release_asset" "example" {
8585
* `created_at` - Date the asset was created
8686
* `updated_at` - Date the asset was last updated
8787
* `browser_download_url` - Browser URL from which the release asset can be downloaded
88-
* `file` - The base64-encoded release asset file contents (requires `download_file` to be `true`)
88+
* `file_contents` - The base64-encoded release asset file contents (requires `download_file_contents` to be `true`)

0 commit comments

Comments
 (0)