-
Notifications
You must be signed in to change notification settings - Fork 87
51 lines (41 loc) · 1.23 KB
/
formatter.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
46
47
48
49
50
51
name: Format
on:
pull_request_target:
paths:
- '**.editorconfig'
- '**.globalconfig'
- '**.cs'
- .github/workflows/formatter.yml
permissions:
contents: write
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
show-progress: false
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
- name: Cache .NET tools
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: dotnet-tools-${{ runner.os }}-${{ hashFiles('.config/dotnet-tools.json') }}
restore-keys: dotnet-tools-${{ runner.os }}-
- name: Setup .NET
uses: actions/setup-dotnet@v4
- name: Restore tools
run: dotnet tool restore
- name: Format scripts
run: dotnet tool run dotnet-format --fix-whitespace --no-restore
- name: Set Git config
run: |
git config user.name octocat
git config user.email octocat@users.noreply.github.com
- name: Commit changes
run: |
git add .
git commit -m "style: fix whitespaces" || true
git push || true