Initial v1.0 implementation #209
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Format *.cs files | |
| on: | |
| pull_request: | |
| branches: | |
| - 'main' | |
| - 'preview/**' | |
| - 'release/**' | |
| - 'support/**' | |
| paths: | |
| - '**.cs' | |
| permissions: | |
| actions: read | |
| contents: write | |
| concurrency: | |
| group: format-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: false | |
| env: | |
| dotnet-sdk-version: '9.x' | |
| jobs: | |
| formatting: | |
| name: Format whitespace, code style and file header | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout ${{ github.head_ref || github.ref }} | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: ${{ env.dotnet-sdk-version }} | |
| - name: Format with .NET CLI | |
| run: | | |
| dotnet format whitespace | |
| dotnet format style | |
| dotnet format analyzers --diagnostics IDE0005 IDE0073 | |
| working-directory: ${{ github.workspace }} | |
| - name: 'Push changes' | |
| uses: './.github/actions/push-changes' | |
| with: | |
| commit-message: 'Formatted csharp files' |