diff --git a/Dockerfile b/Dockerfile index 1f159db1..709a7d27 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,7 +31,7 @@ RUN apk add --no-cache \ ca-certificates less ncurses-terminfo-base \ krb5-libs libgcc libintl libssl1.1 libstdc++ \ tzdata userspace-rcu zlib icu-libs lttng-ust - + ######################################### # Install Powershell + PSScriptAnalyzer # ######################################### @@ -100,7 +100,9 @@ RUN gem install rubocop:0.74.0 rubocop-rails rubocop-github:0.13.0 # Need to fix the version as it installs 'rubocop:0.85.1' as a dep, and forces the default # We then need to promote the correct version, uninstall, and fix deps -RUN sh -c 'gem install --default rubocop:0.74.0; yes | gem uninstall rubocop:0.85.1 -a -x -I; gem install rubocop:0.74.0' +RUN sh -c 'INCORRECT_VERSION=$(gem list rhc -e rubocop |grep rubocop |awk "{print $2}" |cut -d"(" -f2|cut -d"," -f1); \ + gem install --default rubocop:0.74.0; \ + yes | gem uninstall rubocop:$INCORRECT_VERSION -a -x -I; gem install rubocop:0.74.0' ###################### # Install shellcheck # @@ -173,4 +175,4 @@ COPY TEMPLATES /action/lib/.automation ###################### # Set the entrypoint # ###################### -ENTRYPOINT ["/action/lib/linter.sh"] \ No newline at end of file +ENTRYPOINT ["/action/lib/linter.sh"]