1
0
Fork 0
mirror of https://github.com/imjasonh/setup-crane synced 2026-07-06 22:52:45 +00:00

Merge pull request #19 from imjasonh/copilot/quote-variables-in-conditions

Quote shell variables in setup action extraction path handling
This commit is contained in:
Jason Hall 2026-06-26 18:37:04 -04:00 committed by GitHub
commit feee3b6bb0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -36,7 +36,7 @@ runs:
esac
os="${RUNNER_OS}"
if [[ $os == "macOS" ]]; then
if [[ "$os" == "macOS" ]]; then
os="Darwin"
fi
@ -50,16 +50,16 @@ runs:
out=crane.exe
fi
if [[ ! -z ${url} ]]; then
if [[ ! -z "${url}" ]]; then
echo "Installing crane for ${os} on ${arch}"
tmp=$(mktemp -d)
cd ${tmp}
cd "${tmp}"
fname="go-containerregistry_${os}_${arch}.tar.gz"
curl -o "$fname" -fsSL --retry 5 --retry-delay 1 --retry-all-errors "${url}/${fname}"
tar xzf "$fname" ${out}
chmod +x ${tmp}/${out}
PATH=${PATH}:${tmp}
echo "${tmp}" >> $GITHUB_PATH
tar xzf "$fname" "${out}"
chmod +x "${tmp}/${out}"
PATH="${PATH}:${tmp}"
echo "${tmp}" >> "$GITHUB_PATH"
fi
# NB: username doesn't seem to matter.