rbbist commited on
Commit
dc18311
·
verified ·
1 Parent(s): 89d0265

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -3
app.py CHANGED
@@ -3,6 +3,10 @@ import requests
3
  from datetime import datetime, timezone, timedelta
4
  import os
5
  import google.generativeai as genai
 
 
 
 
6
 
7
  def get_all_commits_in_range(owner, repo_name, start_date, end_date, token):
8
  """
@@ -228,7 +232,7 @@ with gr.Blocks(title="Git Commit Story Analyzer", theme=gr.themes.Soft()) as app
228
 
229
  analyze_btn.click(
230
  fn=analyze_commits,
231
- inputs=[repo_input, start_date_input, end_date_input, github_token_input, gemini_key_input],
232
  outputs=output
233
  )
234
 
@@ -238,8 +242,14 @@ with gr.Blocks(title="Git Commit Story Analyzer", theme=gr.themes.Soft()) as app
238
 
239
  1. **Enter Repository**: Provide the GitHub repository (e.g., `torvalds/linux` or full URL)
240
  2. **Select Date Range**: Choose single day or date range for analysis
241
- 3. **Add Tokens**: Provide your GitHub Personal Access Token and Gemini API Key
242
- 4. **Analyze**: Click the button to generate your commit story
 
 
 
 
 
 
243
 
244
  **Note**: The tool fetches commits from all branches and removes duplicates automatically.
245
  """)
 
3
  from datetime import datetime, timezone, timedelta
4
  import os
5
  import google.generativeai as genai
6
+ from dotenv import load_dotenv
7
+
8
+ # Load environment variables from .env file
9
+ load_dotenv()
10
 
11
  def get_all_commits_in_range(owner, repo_name, start_date, end_date, token):
12
  """
 
232
 
233
  analyze_btn.click(
234
  fn=analyze_commits,
235
+ inputs=[repo_input, start_date_input, end_date_input],
236
  outputs=output
237
  )
238
 
 
242
 
243
  1. **Enter Repository**: Provide the GitHub repository (e.g., `torvalds/linux` or full URL)
244
  2. **Select Date Range**: Choose single day or date range for analysis
245
+ 3. **Analyze**: Click the button to generate your commit story
246
+
247
+ ### 🔧 Setup Instructions for Hugging Face Spaces
248
+
249
+ Before deploying, add these secrets in your Space settings:
250
+ 1. Go to Settings → Repository secrets
251
+ 2. Add `GITHUB_TOKEN` - Get from GitHub: Settings → Developer settings → Personal access tokens
252
+ 3. Add `GEMINI_API_KEY` - Get from [Google AI Studio](https://makersuite.google.com/app/apikey)
253
 
254
  **Note**: The tool fetches commits from all branches and removes duplicates automatically.
255
  """)