From 1ef1c58653dd6f854d1c36ff88ff8c77c75959dc Mon Sep 17 00:00:00 2001 From: K <39096245+KishtheBeast@users.noreply.github.com> Date: Thu, 19 Mar 2026 15:12:45 -0400 Subject: [PATCH 1/5] chore: jig reconciliation updates --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 411d91f..3cfda8c 100644 --- a/main.tf +++ b/main.tf @@ -1,5 +1,5 @@ module "private_service" { - source = "github.com/jig-test-custome/test-tf-modules?ref=v1.0.0" + source = "github.com/jig-test-custome/test-tf-modules?ref=main" name = "my-service" } From 0043f58093d84dbabeab9e61a80f80b35a700716 Mon Sep 17 00:00:00 2001 From: K <39096245+KishtheBeast@users.noreply.github.com> Date: Thu, 19 Mar 2026 15:13:09 -0400 Subject: [PATCH 2/5] chore: jig reconciliation updates --- main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.tf b/main.tf index 3cfda8c..dfffef2 100644 --- a/main.tf +++ b/main.tf @@ -1,8 +1,8 @@ module "private_service" { - source = "github.com/jig-test-custome/test-tf-modules?ref=main" + source = "github.com/jig-test-custome/test-tf-modules?ref=v1.0.0" name = "my-service" } module "another_service" { - source = "git::https://github.com/jig-test-custome/test-tf-modules.git?ref=old-branch" + source = "git::https://github.com/jig-test-custome/test-tf-modules.git?ref=develop" } From a1163bde743385266153c5a9d05d2b640a72260a Mon Sep 17 00:00:00 2001 From: K <39096245+KishtheBeast@users.noreply.github.com> Date: Thu, 19 Mar 2026 15:32:41 -0400 Subject: [PATCH 3/5] chore: jig reconciliation updates --- TEST_FILE.txt | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 TEST_FILE.txt diff --git a/TEST_FILE.txt b/TEST_FILE.txt new file mode 100644 index 0000000..4b8814d --- /dev/null +++ b/TEST_FILE.txt @@ -0,0 +1,6 @@ + +> [!IMPORTANT] +> **Managed by Jig** — Auto-generated compliance content. Manual edits _inside this block_ will be overwritten on next sync. + +Selector test file - repo: + From 374b0dc5356a9c17f3fc148929452bc82f855efe Mon Sep 17 00:00:00 2001 From: K <39096245+KishtheBeast@users.noreply.github.com> Date: Thu, 19 Mar 2026 20:03:22 -0400 Subject: [PATCH 4/5] chore: jig reconciliation updates --- SECURITY.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..3ad146f --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,8 @@ + +> [!IMPORTANT] +> **Managed by Jig** — Auto-generated compliance content. Manual edits _inside this block_ will be overwritten on next sync. + +# Security Policy + +If you discover a security vulnerability, please report it to us at global-sec@enterprise.com. + From 86e42c43a447f93c0a8621cce40d167765f6def5 Mon Sep 17 00:00:00 2001 From: K <39096245+KishtheBeast@users.noreply.github.com> Date: Sun, 29 Mar 2026 15:37:38 -0400 Subject: [PATCH 5/5] chore: jig reconciliation updates --- .github/workflows/jig-terraform-check.yml | 80 +++++++++++++++++++++++ main.tf | 4 +- modules/compute/main.tf | 2 +- 3 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/jig-terraform-check.yml diff --git a/.github/workflows/jig-terraform-check.yml b/.github/workflows/jig-terraform-check.yml new file mode 100644 index 0000000..6de24bb --- /dev/null +++ b/.github/workflows/jig-terraform-check.yml @@ -0,0 +1,80 @@ +name: jig-terraform-check + +on: + pull_request: + branches: [ main, master ] + +jobs: + check-module-versions: + name: jig-terraform-check + runs-on: ubuntu-latest + steps: + - name: Checkout PR branch + uses: actions/checkout@v4 + + - name: Check Terraform module version compliance + shell: bash + run: | + FAILED=0 + + while IFS= read -r -d '' tf_file; do + python3 - "$tf_file" <<'PYEOF' + import sys, re + + tf_file = sys.argv[1] + modules_to_check = [ + {"source": "terraform-aws-modules/vpc/aws", "check_type": "version", "desired": "6.1.1"}, + {"source": "github.com/jig-test-custome/test-tf-modules", "check_type": "ref", "desired": "main"}, + ] + + with open(tf_file) as f: + content = f.read() + + module_blocks = re.findall(r'module\s+"[^"]+"\s*\{([^}]+)\}', content, re.DOTALL) + + for entry in modules_to_check: + module_source = entry["source"] + check_type = entry["check_type"] + desired_value = entry["desired"] + + for block in module_blocks: + source_match = re.search(r'source\s*=\s*"([^"]+)"', block) + if not source_match: + continue + + source = source_match.group(1) + source_base = re.sub(r'\?ref=.*$', '', source) + + if check_type == 'ref': + if source_base != module_source: + continue + ref_match = re.search(r'\?ref=(.+)$', source) + current = ref_match.group(1) if ref_match else '' + else: + if source != module_source: + continue + ver_match = re.search(r'version\s*=\s*"([^"]+)"', block) + if ver_match is None: + continue # version is a variable reference, not a literal — skip + current = ver_match.group(1) + + if current != desired_value: + print(f"FAIL: {tf_file}: module source '{module_source}' has {check_type}='{current}', expected '{desired_value}'") + sys.exit(1) + PYEOF + + if [ $? -ne 0 ]; then + FAILED=1 + fi + done < <(find . -name '*.tf' -not -path './.terraform/*' -print0) + + if [ $FAILED -ne 0 ]; then + echo "" + echo "Module version policy violation detected." + echo "Expected module 'terraform-aws-modules/vpc/aws' to use version='6.1.1'." + echo "Expected module 'github.com/jig-test-custome/test-tf-modules' to use ref='main'." + echo "Run 'jig run' or merge the Jig reconciliation PR to fix this." + exit 1 + fi + + echo "All terraform module versions are compliant." diff --git a/main.tf b/main.tf index dfffef2..e01c317 100644 --- a/main.tf +++ b/main.tf @@ -1,8 +1,8 @@ module "private_service" { - source = "github.com/jig-test-custome/test-tf-modules?ref=v1.0.0" + source = "github.com/jig-test-custome/test-tf-modules?ref=main" name = "my-service" } module "another_service" { - source = "git::https://github.com/jig-test-custome/test-tf-modules.git?ref=develop" + source = "git::https://github.com/jig-test-custome/test-tf-modules.git?ref=main" } diff --git a/modules/compute/main.tf b/modules/compute/main.tf index 1ef3483..839fbe5 100644 --- a/modules/compute/main.tf +++ b/modules/compute/main.tf @@ -1,5 +1,5 @@ module "ec2_instance" { source = "terraform-aws-modules/ec2-instance/aws" - version = "5.0.0" + version = "5.5.0" name = "single-instance" }