Skip to content

Commit

Permalink
refact: apply suggestions from code review
Browse files Browse the repository at this point in the history
Note: on top of the code review, a minor text modification was
performed.
  • Loading branch information
SMoraisAnsys committed Jan 25, 2024
1 parent 38c57ff commit 820a82f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 820a82f

Please sign in to comment.