commit fc381a6cdee215f7e8db6f71a123df9b21de2066
parent 5d4377cfa65c701a6da71102389b9f84420c70f1
Author: Amit Dutta <amitdutta4255@gmail.com>
Date: Mon, 4 May 2026 21:06:34 +0530
Update update_commits.py
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/.github/scripts/update_commits.py b/.github/scripts/update_commits.py
@@ -19,7 +19,11 @@ def fetch_recent_commits():
# We only care about events where you pushed code
if event['type'] == 'PushEvent':
repo_name = event['repo']['name']
- for commit in event['payload']['commits']:
+
+ # Safely get the commits list (defaults to an empty list if missing)
+ commits_list = event['payload'].get('commits', [])
+
+ for commit in commits_list:
# Extract the first line of the commit message (removes long descriptions)
msg = commit['message'].split('\n')[0]
@@ -44,6 +48,7 @@ def update_readme(commits):
print("No commits found to update.")
return
+ # Format the commits back to standard markdown bullet points
commit_list_md = "\n".join(commits)
# Read the current README.md