feat: avoid redundant binary downloads and notify when skipping (#210)
Some checks failed
v1 version / test deploy artifact (push) Failing after 3s
v1 version / test changed-files (push) Failing after 3s
v1 version / test Multiple Host (push) Failing after 2s
lint and test / test scp action (push) Failing after 2s
lint and test / test changed-files (push) Failing after 2s
lint and test / test target folder (push) Failing after 2s
v1 version / test scp action (push) Failing after 7m27s
v1 version / test target folder (push) Failing after 8m55s
lint and test / test deploy artifact (push) Failing after 10m24s
lint and test / test Multiple Host (push) Failing after 10m52s

* feat: avoid redundant binary downloads and notify when skipping

- Skip downloading the binary if it already exists, and print a message instead

Signed-off-by: appleboy <appleboy.tw@gmail.com>

* Update entrypoint.sh

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Signed-off-by: appleboy <appleboy.tw@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
Bo-Yi Wu
2025-08-31 10:31:45 +08:00
committed by GitHub
parent 9132c85c5f
commit eb443bd494

View File

@ -39,8 +39,12 @@ if [[ "${INPUT_CURL_INSECURE}" == 'true' ]]; then
INSECURE_OPTION="--insecure"
fi
curl -fsSL --retry 5 --keepalive-time 2 ${INSECURE_OPTION} "${DOWNLOAD_URL_PREFIX}/${CLIENT_BINARY}" -o "${TARGET}"
chmod +x "${TARGET}"
if [[ ! -x "${TARGET}" ]]; then
curl -fsSL --retry 5 --keepalive-time 2 ${INSECURE_OPTION} "${DOWNLOAD_URL_PREFIX}/${CLIENT_BINARY}" -o "${TARGET}"
chmod +x "${TARGET}"
else
echo "Binary ${CLIENT_BINARY} already exists and is executable, skipping download."
fi
echo "======= CLI Version Information ======="
"${TARGET}" --version