2020 with :
2121 python-version : " 3.10"
2222
23+ - name : Set shfmt version environment variable
24+ run : echo "SHFMT_VERSION=v3.7.0" >> $GITHUB_ENV
25+
2326 - name : Cache pip dependencies
2427 uses : actions/cache@v3
2528 with :
@@ -32,18 +35,18 @@ jobs:
3235 uses : actions/cache@v3
3336 with :
3437 path : /usr/local/bin/shfmt
35- # key: ${{ runner.os }}-shfmt-${{ env.SHFMT_VERSION }}
36- key : ${{ runner.os }}-shfmt-
38+ key : ${{ runner.os }}-shfmt-${{ env.SHFMT_VERSION }}
3739 restore-keys : |
40+ ${{ runner.os }}-shfmt-${{ env.SHFMT_VERSION }}
3841 ${{ runner.os }}-shfmt-
3942
4043 - name : Cache Pre-Commit environments
4144 uses : actions/cache@v3
4245 with :
4346 path : ~/.cache/pre-commit
44- # key: ${{ runner.os }}-pc-${{ hashFiles('.pre-commit-config.yaml') }}
45- key : ${{ runner.os }}-pc-
47+ key : ${{ runner.os }}-pc-${{ hashFiles('.pre-commit-config.yaml') }}
4648 restore-keys : |
49+ ${{ runner.os }}-pc-${{ hashFiles('.pre-commit-config.yaml') }}
4750 ${{ runner.os }}-pc-
4851
4952 - name : Install dependencies
5356
5457 - name : Install shfmt
5558 run : |
56- SHFMT_VERSION="v3.7.0"
59+ SHFMT_VERSION=${{ env.SHFMT_VERSION }}
5760 SHFMT_BIN="shfmt_${SHFMT_VERSION}_linux_amd64"
5861 if [[ ! -f /usr/local/bin/shfmt ]]; then
5962 wget -O shfmt "https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/${SHFMT_BIN}"
8184 else
8285 pre-commit run --from-ref origin/$DEFAULT_BRANCH --to-ref $CUR_SHA
8386 fi
84-
85- # git fetch origin $DEFAULT_BRANCH
86- # LAST_SHA=$(git log --pretty=tformat:"%H" -n2 . | tail -n1)
87- # echo "Last SHA is $LAST_SHA"
88- # pre-commit run --from-ref $LAST_SHA --to-ref $CUR_SHA
0 commit comments