From b67b5ff1c56ed5ce12c66efb9150e149309975fe Mon Sep 17 00:00:00 2001 From: MaxymVlasov Date: Wed, 29 Sep 2021 12:24:44 +0300 Subject: [PATCH] Add shfmt to workflow --- .github/workflows/pre-commit.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index 773ff8e09..9672e077f 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -9,12 +9,23 @@ jobs: - uses: actions/checkout@v2 - run: | git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* + - name: Get changed files id: file_changes run: | export DIFF=$(git diff --name-only origin/${{ github.base_ref }} ${{ github.sha }}) echo "Diff between ${{ github.base_ref }} and ${{ github.sha }}" echo "::set-output name=files::$( echo "$DIFF" | xargs echo )" + + - name: Install shfmt + run: | + curl -L "$(curl -s https://api.github.com/repos/mvdan/sh/releases/latest | grep -o -E -m 1 "https://.+?linux_amd64")" > shfmt \ + && chmod +x shfmt && sudo mv shfmt /usr/bin/ + # Need to success pre-commit fix push + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: actions/setup-python@v2 with: python-version: '3.9'