Skip to content

Commit 6a8fc24

Browse files
committed
Fix indentation issue with github_repository_file and heredocs
Signed-off-by: Timo Sand <[email protected]>
1 parent 9d3aeb5 commit 6a8fc24

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

github/resource_github_organization_ruleset_test.go

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ func TestAccGithubOrganizationRuleset(t *testing.T) {
1919
workflowFilePath := ".github/workflows/echo.yaml"
2020

2121
config := fmt.Sprintf(`
22+
locals {
23+
workflow_content = <<EOT
24+
name: Echo Workflow
25+
26+
on: [pull_request]
27+
28+
jobs:
29+
echo:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- run: echo "Hello, world!"
33+
EOT
34+
}
2235
resource "github_repository" "test" {
2336
name = "%s"
2437
visibility = "private"
@@ -30,17 +43,7 @@ resource "github_repository_file" "workflow_file" {
3043
repository = github_repository.test.name
3144
branch = "main"
3245
file = "%[3]s"
33-
content = <<EOT
34-
name: Echo Workflow
35-
36-
on: [pull_request]
37-
38-
jobs:
39-
echo:
40-
runs-on: linux
41-
steps:
42-
- run: echo \"Hello, world!\"
43-
EOT
46+
content = replace(local.workflow_content, "\t", " ") # NOTE: 'content' must be indented with spaces, not tabs
4447
commit_message = "Managed by Terraform"
4548
commit_author = "Terraform User"
4649
commit_email = "[email protected]"

0 commit comments

Comments
 (0)