Skip to content

Merge pull request #12 from joanvallve/9-default-values-for-custom-cl… #8

Merge pull request #12 from joanvallve/9-default-values-for-custom-cl…

Merge pull request #12 from joanvallve/9-default-values-for-custom-cl… #8

Workflow file for this run

name: clang-format
on: [push, pull_request]
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install clang
run: sudo apt install -y clang-format-12
- name: config git & temporary branch
run: |
if [ `git rev-parse --verify ci_processing 2>/dev/null` ]; then
git branch -D ci_processing
fi
git config --global user.email "[email protected]"
git config --global user.name "continuous integration"
git checkout -b ci_processing
- name: apply clang format
run: find . -iname *.h -o -iname *.cpp -o -iname *.hpp | xargs clang-format-12 --style=file -i
- name: push changes if any
run: |
if git commit -a -m "[skip ci] clang format" ; then
git push origin ci_processing:${BRANCH_NAME}
else
echo "No changes, nothing to commit!"
fi