File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 19
19
then
20
20
CURRENT_RELEASE=$( jq -r " .current_release.${FLUTTER_CHANNEL} " " $FLUTTER_RELEASE_MANIFEST_FILE " )
21
21
FLUTTER_VERSION=$( jq -r " .releases | map(select(.hash == \" ${CURRENT_RELEASE} \" )) | .[0].version" " $FLUTTER_RELEASE_MANIFEST_FILE " )
22
+ FLUTTER_SHA256=$( jq -r " .releases | map(select(.hash == \" ${CURRENT_RELEASE} \" )) | .[0].sha256" " $FLUTTER_RELEASE_MANIFEST_FILE " )
22
23
rm " $FLUTTER_RELEASE_MANIFEST_FILE "
23
24
else
24
25
echo -e " ::error::Failed to detect the latest version."
@@ -82,7 +83,18 @@ if [ ! -d "${FLUTTER_RUNNER_TOOL_CACHE}" ]; then
82
83
83
84
# Download installation archive
84
85
DOWNLOAD_PATH=" ${RUNNER_TEMP} /${FLUTTER_BUILD} "
85
- curl --connect-timeout 15 --retry 5 " $FLUTTER_DOWNLOAD_URL " > ${DOWNLOAD_PATH}
86
+ if curl --connect-timeout 15 --retry 5 " $FLUTTER_DOWNLOAD_URL " > ${DOWNLOAD_PATH} ;
87
+ then
88
+ if [[ $OS == " linux" ]]
89
+ then
90
+ echo " ${FLUTTER_SHA256} ${DOWNLOAD_PATH} " | sha256sum -c -
91
+ else
92
+ echo " ${FLUTTER_SHA256} ${DOWNLOAD_PATH} " | shasum -a 256 -c -
93
+ fi
94
+ else
95
+ echo -e " ::error::Download failed! Please check passed arguments."
96
+ exit 1
97
+ fi
86
98
87
99
# Prepare tool cache folder
88
100
mkdir -p " ${FLUTTER_RUNNER_TOOL_CACHE} "
You can’t perform that action at this time.
0 commit comments