File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Format
2+
3+ on :
4+ workflow_call :
5+ inputs :
6+ dotnet_version :
7+ description : " The .NET SDK version to use"
8+ required : false
9+ default : " 9.0.x"
10+ type : string
11+ secrets :
12+ GH_TOKEN :
13+ description : " GitHub token with write permissions"
14+ required : false
15+
16+ jobs :
17+ format :
18+ runs-on : ubuntu-latest
19+
20+ steps :
21+ - name : Checkout Code
22+ uses : actions/checkout@v4
23+ with :
24+ token : ${{ secrets.GH_TOKEN || github.token }}
25+
26+ - name : Setup .NET
27+ uses : actions/setup-dotnet@v4
28+ with :
29+ dotnet-version : ${{ inputs.dotnet_version }}
30+
31+ - name : Format Code
32+ run : dotnet format
33+
34+ - name : Commit & Push Updated Styles
35+ if : always()
36+ continue-on-error : true
37+ run : |
38+ git config --global user.name 'github-actions'
39+ git config --global user.email 'github-actions@github.com'
40+ git diff --quiet || (git commit -am "chore: format code with dotnet format" && git push)
You can’t perform that action at this time.
0 commit comments