Skip to content

Commit

Permalink
chore: Add shfmt to workflow (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxymVlasov authored Sep 29, 2021
1 parent ff54bb4 commit cf6603c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit cf6603c

Please sign in to comment.