Git Module Reference
Git Module Reference
Section titled “Git Module Reference”The git module provides Git-specific origins and destinations.
Origins
Section titled “Origins”git.origin
Section titled “git.origin”Basic Git origin:
git.origin( url = "https://...", # Repository URL ref = "main", # Branch/tag/commit submodules = "NO", # "NO", "YES", "RECURSIVE" first_parent = False, # Follow first parent only partial_fetch = False, # Enable partial clone)git.github_origin
Section titled “git.github_origin”GitHub-specific origin:
git.github_origin( url = "https://github.com/...", # Repository URL ref = "main", # Branch/tag/commit review_state = None, # "APPROVED", "CHANGES_REQUESTED" review_approvers = [], # List of approvers)git.github_pr_origin
Section titled “git.github_pr_origin”Read from GitHub PRs:
git.github_pr_origin( url = "https://github.com/...", # Repository URL branch = "main", # Base branch state = "OPEN", # "OPEN", "CLOSED", "ALL" required_labels = [], # Required PR labels required_status_context_names = [], # Required CI checks)git.gerrit_origin
Section titled “git.gerrit_origin”Gerrit origin:
git.gerrit_origin( url = "https://gerrit.../", # Repository URL ref = "refs/heads/main", # Reference)git.github_trigger
Section titled “git.github_trigger”GitHub event trigger:
git.github_trigger( url = "https://github.com/...", # Repository URL events = ["pull_request", "push"], # Event types)Destinations
Section titled “Destinations”git.destination
Section titled “git.destination”Basic Git destination:
git.destination( url = "https://...", # Repository URL push = "main", # Branch to push fetch = "main", # Branch to fetch (default: push) tag_name = None, # Optional tag tag_msg = None, # Tag message skip_push = False, # Skip push (for testing))git.github_destination
Section titled “git.github_destination”GitHub destination:
git.github_destination( url = "https://github.com/...", # Repository URL push = "main", # Branch to push)git.github_pr_destination
Section titled “git.github_pr_destination”Create GitHub PRs:
git.github_pr_destination( url = "https://github.com/...", # Repository URL destination_ref = "main", # Target branch pr_branch = "sync-${REF}", # PR branch name title = "Sync", # PR title body = "Description", # PR body draft = False, # Create as draft update_description = True, # Update on re-run assignees = [], # PR assignees labels = [], # PR labels)git.gerrit_destination
Section titled “git.gerrit_destination”Gerrit CL destination:
git.gerrit_destination( url = "https://gerrit.../", # Repository URL fetch = "main", # Fetch branch push_to_refs_for = "main", # Target branch submit = False, # Auto-submit notify = "ALL", # Notification level topic = None, # CL topic)API Destinations
Section titled “API Destinations”git.github_api
Section titled “git.github_api”GitHub API for feedback:
git.github_api( url = "https://github.com/...", # Repository URL)git.gerrit_api
Section titled “git.gerrit_api”Gerrit API for feedback:
git.gerrit_api( url = "https://gerrit.../", # Gerrit URL)Review Input
Section titled “Review Input”git.review_input
Section titled “git.review_input”Gerrit review input:
git.review_input( labels = {"Code-Review": 1}, # Review labels message = "LGTM", # Review message)