From 81b64c18b6fd5c908c4d6a985ec33bcebbeff71d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cxxq250=E2=80=9D?= <“xxq250@qq.com”> Date: Tue, 16 Aug 2022 14:03:05 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E5=8F=91=E8=A1=8C=E7=89=88git=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=97=B6=EF=BC=8C=E4=B8=8D=E5=90=8C=E6=AD=A5=E5=A4=84?= =?UTF-8?q?=E7=90=86log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/version_release.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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