Skip to content

Commit d0853e4

Browse files
committed
testing new wrapper
1 parent bb47b2f commit d0853e4

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

devolv/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "0.2.7"
1+
__version__ = "0.2.8"
22

devolv/drift/cli.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ def drift(
1616
policy_file: str = typer.Option(..., "--file", help="Path to local policy file"),
1717
account_id: str = typer.Option(None, "--account-id", help="AWS Account ID (optional, auto-detected if not provided)"),
1818
approvers: str = typer.Option("", help="Comma-separated GitHub usernames for approval"),
19-
approval_anyway: bool = typer.Option(False, "--approval-anyway", help="Request approval even if no drift")
19+
approval_anyway: bool = typer.Option(False, "--approval-anyway", help="Request approval even if no drift"),
20+
repo_full_name: str = typer.Option(None, "--repo", help="GitHub repo full name (e.g., org/repo)")
2021
):
2122
"""
2223
Detect drift between local policy (file) and AWS policy (ARN),
@@ -46,17 +47,25 @@ def drift(
4647
typer.echo("✅ No drift detected. Use --approval-anyway to force approval.")
4748
raise typer.Exit()
4849

50+
# Ensure we know which repo to use
51+
if not repo_full_name:
52+
repo_full_name = os.getenv("GITHUB_REPOSITORY")
53+
54+
if not repo_full_name:
55+
typer.echo("❌ GitHub repo not specified. Use --repo or set GITHUB_REPOSITORY.")
56+
raise typer.Exit(1)
57+
4958
# Create GitHub issue
5059
token = os.getenv("GITHUB_TOKEN")
5160
if not token:
5261
typer.echo("❌ GITHUB_TOKEN not set in environment.")
5362
raise typer.Exit(1)
5463

55-
issue_num = create_approval_issue("owner/repo", token, policy_name)
64+
issue_num = create_approval_issue(repo_full_name, token, policy_name)
5665
typer.echo(f"Issue #{issue_num} created for approval.")
5766

5867
# Wait for sync choice comment
59-
choice = wait_for_sync_choice("owner/repo", issue_num, token)
68+
choice = wait_for_sync_choice(repo_full_name, issue_num, token)
6069

6170
if choice == "local->aws":
6271
merged_doc = merge_policy_documents(local_doc, aws_doc)
@@ -80,7 +89,7 @@ def drift(
8089
branch = f"update-policy-{policy_name}"
8190
pr_title = f"Update {policy_file} from AWS policy"
8291
pr_body = "This PR updates the local policy file with the AWS default version."
83-
pr_num = create_github_pr("owner/repo", branch, pr_title, pr_body)
92+
pr_num = create_github_pr(repo_full_name, branch, pr_title, pr_body)
8493
typer.echo(f"✅ Created PR #{pr_num}: updated {policy_file} from AWS policy.")
8594

8695
else:

0 commit comments

Comments
 (0)