forked from ScottPlot/ScottPlot
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (38 loc) · 1.15 KB
/
task-autoformat-fix.yaml
File metadata and controls
40 lines (38 loc) · 1.15 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
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
uses: actions/checkout@v4
if: github.event_name == 'pull_request'
- name: 🛒 Checkout Manual
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: "9.0.x"
dotnet-quality: "preview"
- name: ✒️ Run Autoformatter
run: bash .github/workflows/scripts/autoformat.sh
- 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 'swharden@gmail.com'
git pull
git commit -am "CI: autoformat"
git push