File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,6 +68,22 @@ for file in $sourceDir/*.json; do
6868
6969 echo " ::::Updating plugin json [$pluginJsonFile ]"
7070
71+ # Calculate SHA256 for the download URL
72+ downloadUrl=$( jq -r ' .downloadUrl' $tmpPluginJsonFile )
73+ echo " ::::Downloading [$downloadUrl ] for SHA256 calculation"
74+ tmpZipFile=" tmp.zip"
75+ curl -# -o $tmpZipFile -L $downloadUrl
76+ if [ $? -eq 0 ]; then
77+ sha256=$( sha256sum $tmpZipFile | awk ' {print $1}' )
78+ echo " ::::Calculated SHA256: $sha256 "
79+ # Add or update sha256 field
80+ jq --arg sha256 " $sha256 " ' . + {sha256: $sha256}' $tmpPluginJsonFile > tmp_with_sha.json
81+ mv tmp_with_sha.json $tmpPluginJsonFile
82+ rm $tmpZipFile
83+ else
84+ echo " Failed to download $downloadUrl for SHA256 calculation"
85+ fi
86+
7187 jq . $tmpPluginJsonFile > $pluginJsonFile
7288
7389 # 如果版本不一致,则需要提交
You can’t perform that action at this time.
0 commit comments