|
7 | 7 | branches: [main] |
8 | 8 |
|
9 | 9 | env: |
10 | | - TF_VERSION: "~1.11" |
| 10 | + TF_VERSION: "1.14.8" |
11 | 11 |
|
12 | 12 | jobs: |
13 | 13 | fmt: |
|
58 | 58 | - uses: gitleaks/gitleaks-action@v2 |
59 | 59 | env: |
60 | 60 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
61 | | - |
62 | | - # Detect which workspaces have changed — used to gate plan jobs on PRs only |
63 | | - changes: |
64 | | - name: Detect changes |
65 | | - runs-on: ubuntu-latest |
66 | | - if: github.event_name == 'pull_request' |
67 | | - outputs: |
68 | | - root: ${{ steps.filter.outputs.root }} |
69 | | - prod: ${{ steps.filter.outputs.prod }} |
70 | | - nonprod: ${{ steps.filter.outputs.nonprod }} |
71 | | - sandbox: ${{ steps.filter.outputs.sandbox }} |
72 | | - steps: |
73 | | - - uses: actions/checkout@v4 |
74 | | - - uses: dorny/paths-filter@v3 |
75 | | - id: filter |
76 | | - with: |
77 | | - filters: | |
78 | | - root: |
79 | | - - 'workspaces/root/**' |
80 | | - - 'modules/**' |
81 | | - prod: |
82 | | - - 'workspaces/prod/**' |
83 | | - - 'modules/**' |
84 | | - nonprod: |
85 | | - - 'workspaces/nonprod/**' |
86 | | - - 'modules/**' |
87 | | - sandbox: |
88 | | - - 'workspaces/sandbox/**' |
89 | | - - 'modules/**' |
90 | | -
|
91 | | - plan-root: |
92 | | - name: Plan (root) |
93 | | - runs-on: ubuntu-latest |
94 | | - needs: changes |
95 | | - if: needs.changes.outputs.root == 'true' |
96 | | - env: |
97 | | - TF_TOKEN_app_terraform_io: ${{ secrets.TF_API_TOKEN }} |
98 | | - steps: |
99 | | - - uses: actions/checkout@v4 |
100 | | - - uses: hashicorp/setup-terraform@v3 |
101 | | - with: |
102 | | - terraform_version: ${{ env.TF_VERSION }} |
103 | | - - run: terraform -chdir=workspaces/root init |
104 | | - - run: terraform -chdir=workspaces/root plan -no-color |
105 | | - |
106 | | - plan-prod: |
107 | | - name: Plan (prod) |
108 | | - runs-on: ubuntu-latest |
109 | | - needs: changes |
110 | | - if: needs.changes.outputs.prod == 'true' |
111 | | - env: |
112 | | - TF_TOKEN_app_terraform_io: ${{ secrets.TF_API_TOKEN }} |
113 | | - steps: |
114 | | - - uses: actions/checkout@v4 |
115 | | - - uses: hashicorp/setup-terraform@v3 |
116 | | - with: |
117 | | - terraform_version: ${{ env.TF_VERSION }} |
118 | | - - run: terraform -chdir=workspaces/prod init |
119 | | - - run: terraform -chdir=workspaces/prod plan -no-color |
120 | | - |
121 | | - plan-nonprod: |
122 | | - name: Plan (nonprod) |
123 | | - runs-on: ubuntu-latest |
124 | | - needs: changes |
125 | | - if: needs.changes.outputs.nonprod == 'true' |
126 | | - env: |
127 | | - TF_TOKEN_app_terraform_io: ${{ secrets.TF_API_TOKEN }} |
128 | | - steps: |
129 | | - - uses: actions/checkout@v4 |
130 | | - - uses: hashicorp/setup-terraform@v3 |
131 | | - with: |
132 | | - terraform_version: ${{ env.TF_VERSION }} |
133 | | - - run: terraform -chdir=workspaces/nonprod init |
134 | | - - run: terraform -chdir=workspaces/nonprod plan -no-color |
135 | | - |
136 | | - plan-sandbox: |
137 | | - name: Plan (sandbox) |
138 | | - runs-on: ubuntu-latest |
139 | | - needs: changes |
140 | | - if: needs.changes.outputs.sandbox == 'true' |
141 | | - env: |
142 | | - TF_TOKEN_app_terraform_io: ${{ secrets.TF_API_TOKEN }} |
143 | | - steps: |
144 | | - - uses: actions/checkout@v4 |
145 | | - - uses: hashicorp/setup-terraform@v3 |
146 | | - with: |
147 | | - terraform_version: ${{ env.TF_VERSION }} |
148 | | - - run: terraform -chdir=workspaces/sandbox init |
149 | | - - run: terraform -chdir=workspaces/sandbox plan -no-color |
0 commit comments