From 820a82f406318433309e7766a82622fac1b3c40c Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Thu, 25 Jan 2024 09:19:45 +0100 Subject: [PATCH] refact: apply suggestions from code review Note: on top of the code review, a minor text modification was performed. --- action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 2b77bbe..1ec3356 100644 --- a/action.yml +++ b/action.yml @@ -50,14 +50,13 @@ runs: # Check if hadolint exists if [ ! -x "${{ github.action_path }}/bin/hadolint" ]; then echo "::debug::Hadolint binary not found" - mkdir -p ${{ github.action_path }}/bin download_hadolint=true else echo "::debug::Hadolint binary exists" version=$(${{ github.action_path }}/bin/hadolint --version 2>&1) - # Check if hadolint could be executed + # Check if hadolint version can be retrieved if [ $? -ne 0 ]; then - echo "::debug::Hadolint could not be executed" + echo "::debug::Hadolint version cannot be retrieved" download_hadolint=true else # Extract version number @@ -71,6 +70,7 @@ runs: # Download hadolint if necessary if [ "$download_hadolint" = true ]; then echo "::debug::Downloading Hadolint ${{ inputs.version }}" + mkdir -p ${{ github.action_path }}/bin curl -L -s -o ${{ github.action_path }}/bin/hadolint \ "https://github.com/hadolint/hadolint/releases/download/v${{ inputs.version }}/hadolint-Linux-x86_64" chmod +x ${{ github.action_path }}/bin/hadolint