diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 0efbd8900..d9c08aada 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1378,7 +1378,8 @@ class ApplicationController < ActionController::Base end pull_request_id = model['id'] - reponame = project['name'] + identifier = project['identifier'] + reponame = project['reponame'] owner_id = project['user_id'] owner = User.find(owner_id) ownername = owner['login'] @@ -1402,7 +1403,10 @@ class ApplicationController < ActionController::Base updated_at = model['updated_at'] # 查询pull request对应的commit信息 - commits = Gitea::PullRequest::CommitsService.call(ownername, reponame, model['gitea_number']) + commits = Gitea::PullRequest::CommitsService.call(ownername, identifier, model['gitea_number']) + if commits.nil? + return false # 获取pr中变更的commit信息失败 + end commit_shas = [] commits.each do |c| commit_shas << c["Sha"] @@ -1439,7 +1443,8 @@ class ApplicationController < ActionController::Base end pull_request_id = model['id'] - reponame = project['name'] + identifier = project['identifier'] + reponame = project['reponame'] owner_id = project['user_id'] owner = User.find(owner_id) ownername = owner['login'] @@ -1450,7 +1455,10 @@ class ApplicationController < ActionController::Base updated_at = model['updated_at'] # 查询pull request对应的commit信息 - commits = Gitea::PullRequest::CommitsService.call(ownername, reponame, model['gitea_number']) + commits = Gitea::PullRequest::CommitsService.call(ownername, identifier, model['gitea_number']) + if commits.nil? + return false # 获取pr中变更的commit信息失败 + end commit_shas = [] commits.each do |c| commit_shas << c["Sha"]