generated from Kong/template-github-release
-
Notifications
You must be signed in to change notification settings - Fork 3
31 lines (29 loc) · 1.02 KB
/
pre-commit.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
---
# File is synced from Kong/template-generic and will be overwritten
name: pre-commit
on: # yamllint disable-line rule:truthy
pull_request:
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/[email protected]
- name: install shfmt
run: |
mkdir -p $GITHUB_WORKSPACE/bin
curl -L -s -o $GITHUB_WORKSPACE/bin/shfmt https://github.com/mvdan/sh/releases/download/v3.1.2/shfmt_v3.1.2_linux_amd64
chmod +x $GITHUB_WORKSPACE/bin/shfmt
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
- name: pre-commit github auth
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git version
git config --global url."https://${TOKEN}:[email protected]/".insteadOf "[email protected]:"
- uses: pre-commit/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
extra_args: --from-ref origin/${{ github.base_ref }} --to-ref ${{github.event.pull_request.head.sha}}