#111 snake logic #291
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 Check | |
on: | |
push: | |
branches: | |
- main | |
- Develop | |
pull_request: | |
branches: | |
- main | |
- Develop | |
jobs: | |
clang-format-check: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install Clang-Format | |
run: sudo apt-get install clang-format | |
- name: Check Clang-Format | |
run: | | |
if [[ -n $(git diff --name-only --diff-filter=ACMRTUXB "$GITHUB_BASE_REF") ]]; then | |
echo "Formatting files..." | |
git diff --name-only --diff-filter=ACMRTUXB "$GITHUB_BASE_REF" | xargs -I {} clang-format -i {} | |
git diff --exit-code --diff-filter=ACMRTUXB "$GITHUB_BASE_REF" | |
else | |
echo "No code changes found." | |
fi | |