Skip to content

Commit d759efe

Browse files
committed
share tf plan in PR comment
1 parent ed4fba0 commit d759efe

1 file changed

Lines changed: 21 additions & 2 deletions

File tree

β€Ž.github/workflows/aws-iac-prs.ymlβ€Ž

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ jobs:
8989
name: output-eks
9090
path: /tmp/*.out
9191
pr_comment:
92-
needs: eks_primary
92+
needs:
93+
- eks_primary
94+
- aws_core
9395
runs-on: ubuntu-latest
9496
steps:
9597
- name: Download artifact
@@ -111,8 +113,25 @@ jobs:
111113
})
112114
113115
// 2. Prepare format of the comment
116+
const awsCorePlan = fs.readFileSync('output-aws/plan.out', 'utf8');
117+
const eksPrimaryPlan = fs.readFileSync('output-eks/plan.out', 'utf8');
114118
const output = `
115-
#### OpenTofu Format and Style: AWS Core πŸ–Œ\`${{ needs.core_aws.outputs.fmt }}\`
119+
### AWS Core
120+
121+
#### OpenTofu Format and Style πŸ–Œ\`${{ needs.core_aws.outputs.fmt }}\`
122+
123+
#### OpenTofu Plan πŸ“–
124+
125+
<details><summary>Show Plan</summary>
126+
127+
\`\`\`\n
128+
${awsCorePlan}
129+
${{ needs.core_aws.outputs.plan }}
130+
\`\`\`
131+
132+
</details>
133+
134+
### EKS Primary Cluster
116135
#### OpenTofu Format and Style: EKS Primary Cluster πŸ–Œ\`${{ needs.eks_primary.outputs.fmt }}\`
117136
118137
#### OpenTofu Plan: AWS Core πŸ“–

0 commit comments

Comments
Β (0)