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
name: Auto-format
on:
push:
branches-ignore:
- main
- master
permissions:
contents: write
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
otp-version: "27.0"
elixir-version: "1.17"
- name: Install dependencies
run: mix deps.get
- name: Run mix format
run: mix format
- name: Commit formatting changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git diff --quiet && exit 0
git add $(for f in $(gst | grep md | grep -v deleted | grep md | awk '{print $2}'); do echo $f; done | xargs)
git commit -m "style: auto-format with mix format"
git push