INNER CODE UNIT · Python

gh_get_pr_title

bitwarden/android · .github/scripts/label-pr.py:80

def gh_get_pr_title(pr_number: str) -> str:
    """Get the title of a pull request."""
    try:
        result = subprocess.run(
            ["gh", "pr", "view", pr_number, "--json", "title", "--jq", ".title"],
            capture_output=True,
            text=True,
            check=True
        )
        return result.stdout.strip()
    except subprocess.CalledProcessError as e:
        print(f"::error::Error getting PR title: {e}")
        return ""

def gh_add_labels(pr_number: str, labels: list[str]) -> None:
    """Add labels to a pull request (doesn't remove existing labels)."""
    gh_labels = ','.join(labels)
    subprocess.run(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…