Update app.py
Browse files
app.py
CHANGED
|
@@ -10,10 +10,12 @@ def generate_release_notes(github_url, github_token, gemini_api_key, start_date,
|
|
| 10 |
g = Github(github_token)
|
| 11 |
|
| 12 |
# Extract owner and repo from the URL
|
| 13 |
-
|
|
|
|
|
|
|
| 14 |
|
| 15 |
# Get the repository
|
| 16 |
-
repo = g.get_repo(f"{owner}/{
|
| 17 |
|
| 18 |
# Get commits between start_date and end_date
|
| 19 |
commits = repo.get_commits(since=datetime.strptime(start_date, "%Y-%m-%d"),
|
|
@@ -48,7 +50,7 @@ def generate_release_notes(github_url, github_token, gemini_api_key, start_date,
|
|
| 48 |
|
| 49 |
# Set default dates
|
| 50 |
default_end_date = datetime.now()
|
| 51 |
-
default_start_date = default_end_date - timedelta(days=
|
| 52 |
|
| 53 |
# Create Gradio interface
|
| 54 |
iface = gr.Interface(
|
|
|
|
| 10 |
g = Github(github_token)
|
| 11 |
|
| 12 |
# Extract owner and repo from the URL
|
| 13 |
+
parts = github_url.rstrip('/').split('/')
|
| 14 |
+
owner = parts[-2]
|
| 15 |
+
repo_name = parts[-1]
|
| 16 |
|
| 17 |
# Get the repository
|
| 18 |
+
repo = g.get_repo(f"{owner}/{repo_name}")
|
| 19 |
|
| 20 |
# Get commits between start_date and end_date
|
| 21 |
commits = repo.get_commits(since=datetime.strptime(start_date, "%Y-%m-%d"),
|
|
|
|
| 50 |
|
| 51 |
# Set default dates
|
| 52 |
default_end_date = datetime.now()
|
| 53 |
+
default_start_date = default_end_date - timedelta(days=7) # One week ago
|
| 54 |
|
| 55 |
# Create Gradio interface
|
| 56 |
iface = gr.Interface(
|