diff --git a/app/models/version_release.rb b/app/models/version_release.rb index 66acc36e0..00119f806 100644 --- a/app/models/version_release.rb +++ b/app/models/version_release.rb @@ -32,8 +32,8 @@ class VersionRelease < ApplicationRecord has_many :attachments, as: :container, dependent: :destroy def update_sha + return if version_gid.blank? 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["status"].to_s != "-1" + self.update(sha: git_release["sha"]) if git_release.present? && git_release.is_a?(Hash) end end