commit提取贡献者创建时间

This commit is contained in:
xxq250 2023-04-19 20:17:46 +08:00
parent 0b9ebbda4b
commit 7d51829e3c
1 changed files with 4 additions and 4 deletions

View File

@ -33,7 +33,7 @@ namespace :batch_add_contributors do
# "luoyuan <luoyuan7@huawei.com>"
commit_author = "#{commiter['name']} <#{commiter['email']}>"
commit_sha = commit['sha']
next if CommitLog.find_by(commit_id: commit_sha).present?
# next if CommitLog.find_by(commit_id: commit_sha).present?
ref = "master"
commit_message = commit['commit']['message'].to_s.size > 200 ? "Message Data too long" : commit['commit']['message'].to_s.gsub("/n","").gsub("\"","")
# user = User.find_by(mail: commiter['email'])
@ -83,11 +83,11 @@ namespace :batch_add_contributors do
# "luoyuan <luoyuan7@huawei.com>"
commit_author = "#{commiter['name']} <#{commiter['email']}>"
commit_sha = commit['sha']
next if CommitLog.find_by(commit_id: commit_sha).present?
# next if CommitLog.find_by(commit_id: commit_sha).present?
ref = "master"
commit_message = commit['commit']['message'].to_s.size > 200 ? "Message Data too long" : commit['commit']['message'].to_s.gsub("/n","").gsub("\"","")
user = User.find_by(mail: commiter['email'])
user_id = user&.id || project.user_id
# user = User.find_by(mail: commiter['email'])
# user_id = user&.id || project.user_id
commit_date = Time.parse(commit['commit']['author']['date'])
commit_date_str = commit_date.strftime("%Y-%m-%d %H:%M:%S")