Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/expand-terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ jobs:
scripts
terraform/modules

- uses: hashicorp/setup-terraform@v4
with:
terraform_version: "1.7"
terraform_wrapper: false

- name: Expand modules from app.yaml
env:
APP_SERVICE: ${{ github.event.repository.name }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tf-plan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ jobs:
PLAN_BUCKET: javabin-ci-plan-artifacts-${{ inputs.aws_account_id }}
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.ref }}

- uses: hashicorp/setup-terraform@v4
with:
Expand Down
14 changes: 14 additions & 0 deletions scripts/expand-modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,20 @@ def main():
f.write(f' {ds["body"]}\n')
f.write("}\n")

# -- Clean up stale generated files --
generated_filenames = {"backend.tf", "providers.tf", "outputs.tf"}
generated_filenames.update(file_contents.keys())

for f in os.listdir(tf_root):
if not f.endswith(".tf") or f in generated_filenames:
continue
filepath = os.path.join(tf_root, f)
with open(filepath) as fh:
first_line = fh.readline()
if GENERATED_MARKER in first_line:
os.remove(filepath)
print(f" removed stale {f}")

# -- Fingerprint --
import hashlib
with open(app_yaml_path, "rb") as f:
Expand Down
Loading