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:
37
.github/workflows/check-whitespace.yml
vendored
37
.github/workflows/check-whitespace.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user