From 5540d8732c1cf17e59d921be332e0073a8751e31 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Fri, 24 Jan 2025 09:45:47 +0800 Subject: [PATCH] =?UTF-8?q?fixed:=20=E6=B5=81=E6=B0=B4=E7=BA=BF=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E6=9F=A5=E8=AF=A2=E8=BF=90=E8=A1=8C=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=EF=BC=8C=E6=94=B9=E6=88=90=E4=B8=80=E7=BB=B4=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=96=B9=E4=BE=BF=E4=BD=BF=E7=94=A8,=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/v1/projects/actions/actions_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/v1/projects/actions/actions_controller.rb b/app/controllers/api/v1/projects/actions/actions_controller.rb index 5d494d288..824d966ea 100644 --- a/app/controllers/api/v1/projects/actions/actions_controller.rb +++ b/app/controllers/api/v1/projects/actions/actions_controller.rb @@ -33,7 +33,7 @@ class Api::V1::Projects::Actions::ActionsController < Api::V1::Projects::Actions pipeline_type = 1 begin - content = Gitea::Repository::Entries::GetService.call(@project&.owner, @project&.identifier, URI.escape(file), ref: last_action_run.present? ? last_action_run.gsub("refs/heads/","") : @project.default_branch)['content'] + content = Gitea::Repository::Entries::GetService.call(@project&.owner, @project&.identifier, URI.escape(file), ref: last_action_run.present? ? last_action_run.ref.gsub("refs/heads/","") : @project.default_branch)['content'] yaml_string = Base64.decode64(content).force_encoding("GBK").encode("UTF-8") unless Base64.decode64(content).force_encoding('UTF-8').valid_encoding? yaml_string = Base64.decode64(content).force_encoding('UTF-8') yml = YAML.safe_load(yaml_string) @@ -43,7 +43,7 @@ class Api::V1::Projects::Actions::ActionsController < Api::V1::Projects::Actions end @result << { name: file.to_s.gsub(".yml","").gsub(".yaml","") , - branch: last_action_run.present? ? last_action_run.gsub("refs/heads/","") : @project.default_branch, + branch: last_action_run.present? ? last_action_run.ref.gsub("refs/heads/","") : @project.default_branch, pipeline_type: pipeline_type, total: total, success: success,