diff --git a/Dockerfile b/Dockerfile index 9ee29593..7862af27 100644 --- a/Dockerfile +++ b/Dockerfile @@ -434,6 +434,11 @@ ENV RENOVATE_X_IGNORE_RE2="true" ENV VERSION_FILE="/action/linterVersions.txt" RUN mkdir /action +# create the homedir, so that in case it is not present (like on action-runner-controller based selfhosted runners) +# we do not fail at setting /github/workspace as a safe git directory +ENV HOME="/github/home" +RUN mkdir -p "${HOME}" + ENTRYPOINT ["/action/lib/linter.sh"] FROM base_image AS slim diff --git a/test/inspec/super-linter/controls/super_linter.rb b/test/inspec/super-linter/controls/super_linter.rb index d72acd27..52f10989 100644 --- a/test/inspec/super-linter/controls/super_linter.rb +++ b/test/inspec/super-linter/controls/super_linter.rb @@ -18,6 +18,10 @@ control "super-linter-environment-variables" do its("content") { should match(/^(standard|slim)$/) } end + describe os_env("HOME") do + its("content") { should eq "/github/home" } + end + describe os_env("RENOVATE_X_IGNORE_RE2") do its("content") { should eq "true" } end @@ -437,6 +441,7 @@ control "super-linter-validate-directories" do desc "Check that directories that Super-Linter needs are installed." dirs = [ + "/github/home", "/node_modules", "/action/lib", "/action/lib/functions",