forked from ScottPlot/ScottPlot
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (46 loc) · 1.75 KB
/
Copy pathtask-autoformat-fix.yaml
File metadata and controls
48 lines (46 loc) · 1.75 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
39
40
41
42
43
44
45
46
47
48
name: Autoformat Fix
on:
workflow_dispatch:
workflow_call:
secrets:
GH_TOKEN:
required: true
jobs:
sp4-autoformat:
name: Fix
runs-on: ubuntu-latest
steps:
- name: Checkout as Contributor
uses: actions/checkout@v4
if: github.event_name == 'pull_request'
- name: Checkout as Administrator
uses: actions/checkout@v4
if: github.event_name != 'pull_request'
with:
token: ${{ secrets.GH_TOKEN }}
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0"
- name: Autoformat ScottPlot
run: dotnet format "src/ScottPlot5/ScottPlot5/ScottPlot.csproj"
- name: Autoformat ScottPlot Tests
run: dotnet format "src/ScottPlot5/ScottPlot5 Tests/Unit Tests/ScottPlot Unit Tests.csproj"
- name: Autoformat ScottPlot Cookbook
run: dotnet format "src/ScottPlot5/ScottPlot5 Cookbook/ScottPlot Cookbook.csproj"
- name: Autoformat ScottPlot WinForms Demo
run: dotnet format "src/ScottPlot5/ScottPlot5 Demos/ScottPlot5 WinForms Demo/WinForms Demo.csproj"
- name: Autoformat ScottPlot WPF Demo
run: dotnet format "src/ScottPlot5/ScottPlot5 Demos/ScottPlot5 WPF Demo/WPF Demo.csproj"
- name: Inspect Code Format Changes
id: verify_diff
run: git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT
- name: Commit Changes
if: steps.verify_diff.outputs.changed == 'true'
run: |
git config --global user.name 'Scott W Harden (via GitHub Actions)'
git config --global user.email 'swharden@gmail.com'
git config --global core.autocrlf false
git pull
git commit -am "CI: autoformat"
git push