diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 59bd100..627e741 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,29 +1,8 @@ -# Run shellcheck on all shell files in this repository -name: shellcheck +# Run shellcheck and shfmt on all shell files in this repository +name: Lint checks on: [push, pull_request] jobs: shellcheck: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: shellcheck - uses: bewuethr/shellcheck-action@v1 - shfmt-check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 - with: - go-version: '1.14.2' - - uses: actions/cache@v1 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go - restore-keys: | - ${{ runner.os }}-go- - - name: Run shfmt - run: | - GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt - while read -r f; do - PATH=$HOME/go/bin:$PATH shfmt -ci -d -i 4 $f - done < <(find . -type f -name "*.sh") + uses: ClangBuiltLinux/actions-workflows/.github/workflows/shellcheck.yml@main + shfmt: + uses: ClangBuiltLinux/actions-workflows/.github/workflows/shfmt.yml@main