Skip to content

Commit 39e5727

Browse files
committed
fix: use sudo to move binary to /usr/local/bin
For self-hosted runners we need sudo for write permissions to `/usr/local/bin`. PR: #145 Closes: #144
1 parent 0e6b33f commit 39e5727

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

install.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ fi
2727
# Download hadolint if necessary
2828
if [ "${DOWNLOAD}" == "true" ]; then
2929
echo "::debug::Downloading Hadolint ${VERSION}"
30-
# https://github.com/actions/runner-images/issues/3727
31-
# /usr/local/bin exists and is writable by any user
3230
curl -s -L --fail -w 1 -o /tmp/hadolint \
3331
"https://github.com/hadolint/hadolint/releases/download/v${VERSION}/hadolint-Linux-x86_64" ||
3432
(echo "::error::Hadolint (version: ${VERSION}) could not be found. Exiting." && exit 1)
35-
mv /tmp/hadolint /usr/local/bin/hadolint
36-
chmod +x /usr/local/bin/hadolint
33+
chmod +x /tmp/hadolint
34+
# https://github.com/actions/runner-images/issues/3727
35+
# /usr/local/bin exists and is writable by any user
36+
# but some self hosted runners requires superpowers to write there
37+
# https://github.com/jbergstroem/hadolint-gh-action/issues/144
38+
sudo mv /tmp/hadolint /usr/local/bin/hadolint
3739
fi
3840

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

0 commit comments

Comments
 (0)