File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4747 # the branch we are merging into.
4848 BASE_COMMIT=$(git merge-base HEAD ${{ github.event.pull_request.base.sha }})
4949 echo "Running clang-format against branch ${{ github.event.pull_request.base.ref }}, with hash ${{ github.event.pull_request.base.sha }}"
50- COMMIT_FILES=$(git diff --diff-filter d --name-only $BASE_COMMIT | grep -ivE 'LinkDef|Utilities/PCG/')
51- [ "X$COMMIT_FILES" = X ] && { echo "No files to check" ; exit 0; }
50+ COMMIT_FILES=$(git diff --diff-filter d --name-only "$BASE_COMMIT" -- ':!*LinkDef*' ':!Utilities/PCG/')
51+ if [ -z "$COMMIT_FILES" ]; then
52+ echo "No files to check" >&2
53+ echo ::set-output name=clean::true
54+ exit 0
55+ fi
5256 RESULT_OUTPUT="$(git-clang-format --commit $BASE_COMMIT --diff --style file $COMMIT_FILES)"
5357
5458 for x in $COMMIT_FILES; do
Original file line number Diff line number Diff line change 4242 BASE_COMMIT=$(git merge-base HEAD ${{ github.event.pull_request.base.sha }})
4343 echo "Running refactoring against branch ${{ github.event.pull_request.base.ref }}, with hash ${{ github.event.pull_request.base.sha }}"
4444 COMMIT_FILES=$(git diff --diff-filter d --name-only $BASE_COMMIT)
45- [ "X$COMMIT_FILES" = X ] && { echo "No files to check" ; exit 0; }
45+ if [ -z "$COMMIT_FILES" ]; then
46+ echo "No files to check" >&2
47+ echo ::set-output name=clean::true
48+ exit 0
49+ fi
4650 perl -p -i -e "${{ env.REFACTORING }}" $COMMIT_FILES
47- RESULT_OUTPUT="$(git diff)"
4851
4952 if git diff --exit-code; then
5053 echo "Refactoring not needed."
You can’t perform that action at this time.
0 commit comments