Skip to content

Commit 5461c89

Browse files
gmmcalborchero
andauthored
feat: Add support to terragrunt command with --all option (#57) (#60)
Co-authored-by: Oliver Borchert <oliver.borchert@quantco.com>
1 parent 21c6cce commit 5461c89

File tree

29 files changed

+2148
-1112
lines changed

29 files changed

+2148
-1112
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,10 @@ override.tf.json
214214
.terraformrc
215215
terraform.rc
216216

217+
### Terragrunt ###
218+
# Local .terragrunt-cache directories
219+
**/.terragrunt-cache/*
220+
217221
### VisualStudioCode ###
218222
.vscode/*
219223
!.vscode/settings.json

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ GitHub Action to post the output of `terraform plan` to a pull request comment.
1414

1515
## Usage
1616

17+
### With terraform
18+
1719
```yaml
1820
- name: Setup terraform
1921
uses: hashicorp/setup-terraform@v3
@@ -28,6 +30,40 @@ GitHub Action to post the output of `terraform plan` to a pull request comment.
2830
planfile: .planfile
2931
```
3032
33+
### With terragrunt
34+
35+
```yaml
36+
name: Plan
37+
38+
env:
39+
TG_NON_INTERACTIVE: "true"
40+
TG_NO_COLOR: "true"
41+
TG_ALL: "true"
42+
43+
jobs:
44+
plan:
45+
runs-on: ubuntu-latest
46+
container:
47+
image: alpine/terragrunt:tf1.12.1
48+
steps:
49+
- name: Initialize
50+
run: terragrunt init
51+
- name: Plan
52+
run: terragrunt plan -out .planfile
53+
- name: Post PR comment
54+
uses: borchero/terraform-plan-comment@v2
55+
env:
56+
# By default, terragrunt outputs plan including time, log level and message,
57+
# while terraform only outputs message. In order to keep consistency on output
58+
# for proper plan matching of this action, we need to limit this output to only
59+
# message
60+
TG_LOG_CUSTOM_FORMAT: "%msg(path=relative)"
61+
with:
62+
token: ${{ github.token }}
63+
planfile: .planfile
64+
terraform-cmd: terragrunt
65+
```
66+
3167
### Example Comments
3268
3369
<details><summary><b>Collapsed</b></summary>

dist/index.js

Lines changed: 55 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)