-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (35 loc) · 1.24 KB
/
periodic-format.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}