bluenevus commited on
Commit
237ff07
·
verified ·
1 Parent(s): 57e6cf7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
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
- _, _, _, owner, repo = github_url.rstrip('/').split('/')
 
 
14
 
15
  # Get the repository
16
- repo = g.get_repo(f"{owner}/{repo}")
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=30) # One week ago
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(