Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use sudo to move binary to /usr/local/bin #145

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ fi
# Download hadolint if necessary
if [ "${DOWNLOAD}" == "true" ]; then
echo "::debug::Downloading Hadolint ${VERSION}"
# https://github.com/actions/runner-images/issues/3727
# /usr/local/bin exists and is writable by any user
curl -s -L --fail -w 1 -o /tmp/hadolint \
"https://github.com/hadolint/hadolint/releases/download/v${VERSION}/hadolint-Linux-x86_64" ||
(echo "::error::Hadolint (version: ${VERSION}) could not be found. Exiting." && exit 1)
mv /tmp/hadolint /usr/local/bin/hadolint
chmod +x /usr/local/bin/hadolint
chmod +x /tmp/hadolint
# https://github.com/actions/runner-images/issues/3727
# /usr/local/bin exists and is writable by any user
# but some self hosted runners requires superpowers to write there
# https://github.com/jbergstroem/hadolint-gh-action/issues/144
sudo mv /tmp/hadolint /usr/local/bin/hadolint
fi

new_version=$(eval "${EXTRACT_VERSION_CMD}" 2>&1)
Expand Down