-
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (34 loc) · 1.2 KB
/
stylua.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
name: Stylua Checks
on: push
permissions:
contents: write
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Pesde
uses: lumin-org/[email protected]
with:
cache: true
- name: Install Packages
run: pesde install
- name: Run Stylua
uses: JohnnyMorganz/stylua-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: src
- name: Check for changes
run: git diff --exit-code || echo "Changes detected."
- name: Commit and Push Changes
if: always()
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add src
git commit -m "Apply Stylua formatting" || echo "No changes to commit."
git push origin HEAD:${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}