-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (31 loc) · 1.02 KB
/
Copy pathFormat.yml
File metadata and controls
38 lines (31 loc) · 1.02 KB
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
name: Auto-format (pushes in repo)
on:
push:
branches: ["**"] # or ['main', 'develop', 'feature/**']
permissions:
contents: write
jobs:
format-fix:
if: "!contains(github.event.head_commit.message, 'auto-format with JuliaFormatter')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup Julia
uses: julia-actions/setup-julia@v3
with:
version: '1'
- name: Install JuliaFormatter
run: julia -e 'using Pkg; Pkg.add("JuliaFormatter")'
- name: Run formatter (sciml)
run: julia -e 'using JuliaFormatter; format(".", verbose=true)'
- name: Commit & push if changed
run: |
if ! git diff --quiet; then
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "style: auto-format with JuliaFormatter (sciml)"
git push
fi