1
0
mirror of https://github.com/php/doc-en.git synced 2026-03-23 23:32:18 +01:00

Make check-whitespace.ymlcheck the final result only (#2158)

This commit is contained in:
Tim Düsterhus
2023-01-09 19:49:58 +01:00
committed by GitHub
parent e5202c6e49
commit a08aa8dccb

View File

@@ -17,33 +17,10 @@ jobs:
with:
fetch-depth: 0
- name: git log --check
id: check_out
run: |
log=
commit=
while read dash etc
do
case "${dash}" in
"---")
commit="${etc}"
;;
"")
;;
*)
if test -n "${commit}"
then
log="${log}\n${commit}"
echo ""
echo "--- ${commit}"
fi
commit=
log="${log}\n${dash} ${etc}"
echo "${dash} ${etc}"
;;
esac
done <<< $(git log --check --pretty=format:"---% h% s" ${{github.event.pull_request.base.sha}}..)
if test -n "${log}"
then
exit 2
fi
- run: git checkout ${{github.event.pull_request.base.sha}}
- run: git merge --squash ${{github.event.pull_request.head.sha}}
- run: |
git config --global user.name "check-whitespace"
git config --global user.email "check-whitespace@example.com"
- run: git commit -m "Squashed"
- run: git log --check HEAD^..HEAD