From 30e71a3c3462aee59ed318b04787f296d267e7f1 Mon Sep 17 00:00:00 2001 From: Oscar Virot Date: Sat, 21 Dec 2024 11:37:26 +0100 Subject: [PATCH] Add lint check Add run dotnet format check --- .github/workflows/dotnet-format.yaml | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/dotnet-format.yaml diff --git a/.github/workflows/dotnet-format.yaml b/.github/workflows/dotnet-format.yaml new file mode 100644 index 0000000..810df56 --- /dev/null +++ b/.github/workflows/dotnet-format.yaml @@ -0,0 +1,30 @@ +# dotnet-format.yaml +name: dotnet Format + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup .NET + uses: actions/setup-dotnet@v2 + with: + dotnet-version: '8.x.x' # Specify the .NET version you're using + + - name: Run dotnet format + run: dotnet format Module/powershellYK.csproj + continue-on-error: false + + - name: Check for uncommitted changes + run: | + if [[ $(git status --porcelain) ]]; then + echo "There are uncommitted changes after running dotnet format." + exit 1 + fi