ci: fix ci #100
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: Linting | |
on: | |
workflow_dispatch: | |
pull_request: | |
jobs: | |
code-formatting: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone tntcxx | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up clang-format | |
run: sudo apt install -y clang-format | |
shell: bash | |
- name: Run clang-format | |
# Run clang-format on commits off the base branch of the pull request. | |
run: | | |
output=$(git clang-format origin/${{ github.event.pull_request.base.ref }} --diff) | |
if [[ "$output" != "" && "$output" != "no modified files to format" && \ | |
"$output" != "clang-format did not modify any files" ]]; then | |
echo "$output" | |
echo Code formatting changed some files, please review. | |
exit 1 | |
fi | |
shell: bash |