From b93d16c7275f107ce2a460f362b42e9ef3aa7774 Mon Sep 17 00:00:00 2001 From: hy <1048382248@qq.com> Date: Fri, 26 Apr 2024 18:08:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20action.yaml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- action.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/action.yaml b/action.yaml index ed31e17..33c5a09 100644 --- a/action.yaml +++ b/action.yaml @@ -22,12 +22,12 @@ runs: res="" fileStr =${{inputs.file_array}} # 读取 fileStr 变量中的每一行文件路径 - while IFS= read -r filepath; do - # 获取文件的 MD5 哈希值 + echo -e "$fileStr" | while IFS= read -r filepath; do + # 获取文件的哈希值,这里使用 MD5 作为例子 file_hash=$(md5sum "$filepath" | awk '{print $1}') - # 将哈希值追加到 res 变量中 - res+="$file_hash" - done <<< "$fileStr" + # 将哈希值追加到 res 变量中,使用换行符分隔 + res+="$file_hash" + done # 计算 res 的哈希值 final_hash=$(echo -n "$res" | md5sum | awk '{print $1}')