Sync code #1399
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Clang Format Diff | |
on: | |
push: | |
branches: | |
- main | |
- master | |
- coro_http_server | |
pull_request: | |
branches: | |
- main | |
- master | |
- coro_http_server | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: install clang-format | |
run: sudo apt install clang-format | |
- name: check-diff | |
run: | | |
diff=`git-clang-format --diff HEAD^` | |
if ! [[ "$diff" = "no modified files to format" || "$diff" = "clang-format did not modify any files" ]]; then | |
echo "The diff you sent is not formatted correctly." | |
echo "The suggested format is" | |
echo "$diff" | |
exit 1 | |
fi |