serJD commited on
Commit
9541170
·
1 Parent(s): 74a5e38

add check to exclude commits containing "isConnected" tag outdating other branches

Browse files
Files changed (1) hide show
  1. app.py +11 -6
app.py CHANGED
@@ -140,12 +140,17 @@ def sync_to_notion(token, database_id, branch_data):
140
  latest_update = latest_updates.get(branch['Name'], '')
141
  outdated = False
142
  if existing_depends_on:
143
- for dep_name in existing_depends_on:
144
- if dep_name in latest_updates and latest_updates[dep_name] > latest_update:
145
- if "isConnected" not in branch_data[dep_name]["commit_message"]:
146
- # exclude commits where isConnected was used
147
- outdated = True
148
- break
 
 
 
 
 
149
  if not latest_update:
150
  status_tag = "empty"
151
  elif outdated:
 
140
  latest_update = latest_updates.get(branch['Name'], '')
141
  outdated = False
142
  if existing_depends_on:
143
+ for branch in branch_data:
144
+ branch_name = branch['Name']
145
+ if branch_name in existing_depends_on:
146
+ # Check if 'commit_message' exists and contains 'isConnected'
147
+ commit_message = branch.get("commit_message", "")
148
+ if "isConnected" not in commit_message:
149
+ # Additional check for the latest update comparison
150
+ latest_update = latest_updates.get(branch_name, '')
151
+ if branch_name in latest_updates and latest_updates[branch_name] > latest_update:
152
+ outdated = True
153
+ break
154
  if not latest_update:
155
  status_tag = "empty"
156
  elif outdated: