forked from ScottPlot/ScottPlot
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (47 loc) · 1.6 KB
/
Autoformat.yaml
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
# run the autoformatter and commit changes back to the main branch
name: Autoformat
on:
workflow_dispatch:
push:
branches:
- main
paths:
- src/**
env:
DOTNET_VERSION: "8.0.x"
jobs:
sp4-autoformat:
name: Autoformat
runs-on: ubuntu-latest
steps:
- name: 🛒 Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN }}
- name: ✨ Setup .NET ${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: ✒️ ScottPlot4 Core
run: dotnet format "src/ScottPlot4/ScottPlot/"
- name: ✒️ ScottPlot4 Cookbook
run: dotnet format "src/ScottPlot4/ScottPlot.Cookbook/"
- name: ✒️ ScottPlot5 Core
run: dotnet format "src/ScottPlot5/ScottPlot5/"
- name: ✒️ ScottPlot5 Tests
run: dotnet format "src/ScottPlot5/ScottPlot5 Tests/"
- name: ✒️ ScottPlot5 Cookbook
run: dotnet format "src/ScottPlot5/ScottPlot5 Cookbook/"
- name: ✒️ ScottPlot5 Demo
run: dotnet format "src/ScottPlot5/ScottPlot5 Demos/ScottPlot5 WinForms Demo/"
- name: 🧐 Inspect 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 '[email protected]'
git pull
git commit -am "CI: autoformat"
git push