]> git.ipfire.org Git - thirdparty/git.git/blob - .github/workflows/check-whitespace.yml
Merge branch 'ab/makefile-msgfmt-wo-stats'
[thirdparty/git.git] / .github / workflows / check-whitespace.yml
1 name: check-whitespace
2
3 # Get the repository with all commits to ensure that we can analyze
4 # all of the commits contributed via the Pull Request.
5 # Process `git log --check` output to extract just the check errors.
6 # Exit with failure upon white-space issues.
7
8 on:
9 pull_request:
10 types: [opened, synchronize]
11
12 jobs:
13 check-whitespace:
14 runs-on: ubuntu-latest
15 steps:
16 - uses: actions/checkout@v2
17 with:
18 fetch-depth: 0
19
20 - name: git log --check
21 id: check_out
22 run: |
23 log=
24 commit=
25 while read dash etc
26 do
27 case "${dash}" in
28 "---")
29 commit="${etc}"
30 ;;
31 "")
32 ;;
33 *)
34 if test -n "${commit}"
35 then
36 log="${log}\n${commit}"
37 echo ""
38 echo "--- ${commit}"
39 fi
40 commit=
41 log="${log}\n${dash} ${etc}"
42 echo "${dash} ${etc}"
43 ;;
44 esac
45 done <<< $(git log --check --pretty=format:"---% h% s" ${{github.event.pull_request.base.sha}}..)
46
47 if test -n "${log}"
48 then
49 exit 2
50 fi