1
0
Fork 0
mirror of https://github.com/imjasonh/setup-crane synced 2026-07-07 23:15: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 esac
os="${RUNNER_OS}" os="${RUNNER_OS}"
if [[ $os == "macOS" ]]; then if [[ "$os" == "macOS" ]]; then
os="Darwin" os="Darwin"
fi fi
@ -50,16 +50,16 @@ runs:
out=crane.exe out=crane.exe
fi fi
if [[ ! -z ${url} ]]; then if [[ ! -z "${url}" ]]; then
echo "Installing crane for ${os} on ${arch}" echo "Installing crane for ${os} on ${arch}"
tmp=$(mktemp -d) tmp=$(mktemp -d)
cd ${tmp} cd "${tmp}"
fname="go-containerregistry_${os}_${arch}.tar.gz" fname="go-containerregistry_${os}_${arch}.tar.gz"
curl -o "$fname" -fsSL --retry 5 --retry-delay 1 --retry-all-errors "${url}/${fname}" curl -o "$fname" -fsSL --retry 5 --retry-delay 1 --retry-all-errors "${url}/${fname}"
tar xzf "$fname" ${out} tar xzf "$fname" "${out}"
chmod +x ${tmp}/${out} chmod +x "${tmp}/${out}"
PATH=${PATH}:${tmp} PATH="${PATH}:${tmp}"
echo "${tmp}" >> $GITHUB_PATH echo "${tmp}" >> "$GITHUB_PATH"
fi fi
# NB: username doesn't seem to matter. # NB: username doesn't seem to matter.