Skip to content

Commit

Permalink
commit array storing
Browse files Browse the repository at this point in the history
  • Loading branch information
dgparmar14 committed Apr 8, 2024
1 parent 2933b69 commit 7c0bbf1
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions scraper/src/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,19 +176,25 @@ def parse_event(self, event, event_time):
reponame = event["repo"]["name"].split('/')[-1]
branch = event["payload"]["ref"].split('/')[-1]
commits = event["payload"]["commits"]
defaultBranchName = self.get_default_banch(repoOwner, reponame)
# defaultBranchName = self.get_default_banch(repoOwner, reponame)
all_commits = []
for commit in commits:
self.append(
user,
{
"type": "commit_direct",
"time": event_time,
commit_data = {
"title": f'{event["repo"]["name"]}#{commit["sha"]}',
"link": commit["url"],
"text": commit["message"],
"branch": f'{branch} (default)' if branch == defaultBranchName else branch,
},
)
}
all_commits.append(commit_data) # Append commit data to the array
print(all_commits)
self.append(
user,
{
"type": "commit_direct",
"time": event_time,
"title": f'Pushed({len(commits)}) to {event["repo"]["name"]}({branch})',
"commits": all_commits,
},
)

def add_collaborations(self, event, event_time):
collaborators = set()
Expand Down

0 comments on commit 7c0bbf1

Please sign in to comment.