INNER CODE UNIT · Python

render_github_repo_input

mrwadams/stride-gpt · apps/web/main.py:420

def render_github_repo_input():
    """Render the optional GitHub repository URL field and analyse on change.

    This is a "writer": a successful analysis prepends the repo summary to
    ``app_input`` and flags ``_sync_app_desc`` so the primary description box
    picks it up. It must therefore run *before* ``render_app_description`` each
    rerun so the sync happens in the same pass.
    """
    github_url = st.text_input(
        label="Enter GitHub repository URL (optional)",
        placeholder="https://github.com/owner/repo",
        key="github_url",
        help="Enter the URL of the GitHub repository you want to analyze.",
    )

    if github_url and github_url != st.session_state.get("last_analyzed_url", ""):
        if "github_api_key" not in st.session_state or not st.session_state["github_api_key"]:
            st.warning("Please enter a GitHub API key to analyze the repository.")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…