salt/.github/actions/setup-shellcheck/action.yml
Pedro Algarvio 3d89f81fb5
Setup actionlint and shellcheck prior to running pre-commit
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
2023-01-31 05:48:44 +00:00

31 lines
1,019 B
YAML

---
name: setup-shellcheck
description: Setup shellcheck
inputs:
version:
description: The version of shellcheck
default: v0.9.0
runs:
using: composite
steps:
- name: Cache shellcheck Binary
uses: actions/cache@v3
with:
path: /usr/local/bin/shellcheck
key: ${{ runner.os }}-${{ runner.arch }}-shellcheck-${{ inputs.version }}
- name: Setup shellcheck
shell: bash
run: |
if ! command -v shellcheck; then
wget https://github.com/koalaman/shellcheck/releases/download/${{ inputs.version }}/shellcheck-${{ inputs.version }}.${{ runner.os }}.x86_64.tar.xz
tar xf shellcheck-${{ inputs.version }}.${{ runner.os }}.x86_64.tar.xz
mv shellcheck-${{ inputs.version }}/shellcheck /usr/local/bin/shellcheck
rm -rf shellcheck-${{ inputs.version }}.${{ runner.os }}.x86_64.tar.xz shellcheck-${{ inputs.version }}
fi
- name: Show shellcheck Version
shell: bash
run: |
shellcheck --version