From 3218455bf3d005fc39d3864ee34def0a779a32c8 Mon Sep 17 00:00:00 2001 From: Jack Hodgkiss Date: Tue, 7 Jan 2025 23:37:16 +0000 Subject: [PATCH] fix: import missing `SMSLAB` branch protection rules Branch protection rules for `SMSLAB` were missing. The branch protection import assumes default unless specified otherwise. Since SMSLab uses `smslab/[y,z,2]*` and not the repositories default branch it was failing to import as the rule was non-existent. --- terraform/github/import_resources.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/terraform/github/import_resources.py b/terraform/github/import_resources.py index 7bcaf4ba..1d095db5 100755 --- a/terraform/github/import_resources.py +++ b/terraform/github/import_resources.py @@ -235,6 +235,10 @@ def main() -> None: branch_protection_resource = BranchProtection(team_id.name.lower( ), {f"{name}:stackhpc/2024.1": name for name in team_repositories}, parsed_args.dry_run, "_caracal") branch_protection_resource.refresh_resource() + elif team_id == TeamID.SMSLAB: + branch_protection_resource = BranchProtection(team_id.name.lower( + ), {f"{name}:smslab/[y,z,2]*": name for name in team_repositories}, parsed_args.dry_run) + branch_protection_resource.refresh_resource() else: branch_protection_resource = BranchProtection(team_id.name.lower( ), {f"{name}:{default_branches[name]}": name for name in team_repositories}, parsed_args.dry_run)