Skip to content

Periodic Format

Periodic Format #601

name: Periodic Format
on:
workflow_dispatch:
schedule:
- cron: '0 1 * * 1,3,6' # every day at midnight
env:
BUILD_TYPE: Release
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Init Submodules
uses: snickerbockers/submodules-init@v4
- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/Build
- name: Configure CMake
shell: bash
run: cmake -S ${{github.workspace}} -B ${{github.workspace}}/Build -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Format
shell: bash
run: cmake --build Build --config $BUILD_TYPE --target ClangFormat
- name: Commit changes
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "Applied clang-format" -a
- name: Push changes
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}