Skip to content

Commit 3843e8f

Browse files
github-actions[bot]petesramekPete Sramek
authored
Promote develop/1.0 to preview/1.0 (#62)
Promote develop/1.0 to preview/1.0 --------- Co-authored-by: Pete Sramek <me@petesramek.com> Co-authored-by: Pete Sramek <petr.sramek@dropoutcoder.com>
1 parent f419181 commit 3843e8f

File tree

17 files changed

+112
-75
lines changed

17 files changed

+112
-75
lines changed

.github/actions/compile/action.yml renamed to .github/actions/source/compile/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Compile with .NET CLI'
1+
name: 'Compile source code'
22
author: 'Pete Sramek'
33
description: 'Compiles source code, uploads build artifacts.'
44
inputs:
@@ -71,4 +71,4 @@ runs:
7171
uses: actions/upload-artifact@v4
7272
with:
7373
name: ${{ inputs.build-artifacts-name }}
74-
path: ${{ inputs.build-artifacts-glob-pattern }}
74+
path: ${{ inputs.build-artifacts-glob-pattern }}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: 'Format source code'
2+
author: 'Pete Sramek'
3+
description: 'Formats source code using dotnet format tool. Pushes changes to the current branch.'
4+
inputs:
5+
# Required
6+
project-path:
7+
description: 'Path to the project or solution file.'
8+
required: true
9+
# Optional
10+
dotnet_sdk_version:
11+
description: '.NET SDK version. Default: ''9.x'''
12+
required: false
13+
default: '9.x'
14+
format-whitespace:
15+
description: 'Format whitespace. Default: ''true'''
16+
required: false
17+
default: 'true'
18+
format-style:
19+
description: 'Format style. Default: ''true'''
20+
required: false
21+
default: 'true'
22+
format-analyzers:
23+
description: 'Format analyzers. Default: ''false'''
24+
required: false
25+
default: 'false'
26+
format-analyzers-diagnostics-parameter:
27+
description: 'Format analyzers diagnostics parameter. Default: '''''
28+
required: false
29+
default: ''
30+
31+
runs:
32+
using: "composite"
33+
steps:
34+
- name: 'Checkout ${{ github.head_ref || github.ref }}'
35+
uses: actions/checkout@v5
36+
37+
- name: 'Setup .NET ${{ inputs.dotnet_sdk_version }}'
38+
uses: actions/setup-dotnet@v4
39+
with:
40+
dotnet-version: ${{ inputs.dotnet_sdk_version }}
41+
42+
- name: Format whitespace
43+
if: ${{ inputs.format-whitespace == 'true' }}
44+
shell: bash
45+
run: |
46+
dotnet format whitespace
47+
working-directory: ${{ github.workspace }}
48+
49+
- name: Format style
50+
if: ${{ inputs.format-style == 'true' }}
51+
shell: bash
52+
run: |
53+
dotnet format style
54+
working-directory: ${{ github.workspace }}
55+
56+
- name: 'Set target branch'
57+
if: ${{ inputs.format-analyzers == 'true' && inputs.format-analyzers-diagnostics-parameter != '' }}
58+
id: set-diagnostics-parameter
59+
shell: bash
60+
run: |
61+
echo "format-analyzers-diagnostics-parameter=--diagnostics ${{ inputs.format-analyzers-diagnostics-parameter }}" >> $GITHUB_OUTPUT
62+
63+
- name: Format analyzers
64+
if: ${{ inputs.format-analyzers == 'true' }}
65+
shell: bash
66+
run: |
67+
dotnet format analyzers ${{ env.format-analyzers-diagnostics-parameter }}
68+
working-directory: ${{ github.workspace }}
69+
70+
- name: 'Push changes'
71+
uses: './.github/actions/git/push-changes'
72+
with:
73+
commit-message: 'Formatted csharp files'
File renamed without changes.

0 commit comments

Comments
 (0)