fixed 发行版git删除时,不同步处理log
This commit is contained in:
parent
0c10f3ff10
commit
81b64c18b6
|
@ -32,8 +32,8 @@ class VersionRelease < ApplicationRecord
|
||||||
has_many :attachments, as: :container, dependent: :destroy
|
has_many :attachments, as: :container, dependent: :destroy
|
||||||
|
|
||||||
def update_sha
|
def update_sha
|
||||||
|
return if version_gid.blank?
|
||||||
git_release = Gitea::Versions::GetService.call(user.gitea_token, repository&.owner&.login, repository&.identifier, version_gid)
|
git_release = Gitea::Versions::GetService.call(user.gitea_token, repository&.owner&.login, repository&.identifier, version_gid)
|
||||||
Rails.logger.info "git_release======#{git_release}"
|
self.update(sha: git_release["sha"]) if git_release.present? && git_release.is_a?(Hash)
|
||||||
self.update(sha: git_release["sha"]) if git_release.present? && git_release["status"].to_s != "-1"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue