forked from Gitlink/forgeplus
fixed 发行版git删除时,不同步处理
This commit is contained in:
parent
25fa6f427b
commit
98f1723411
|
@ -32,7 +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)
|
||||||
self.update(sha: git_release["sha"])
|
self.update(sha: git_release["sha"]) if git_release.present? && git_release.is_a?(Hash)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue