From de976f9248a3daee251fe6162c8cfc45d8c53d4d Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 14 Jul 2023 23:00:44 +0800 Subject: [PATCH] Create dotnet-format.yml Add github action to check if new/touched file is formatted. --- .github/workflows/dotnet-format.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/dotnet-format.yml diff --git a/.github/workflows/dotnet-format.yml b/.github/workflows/dotnet-format.yml new file mode 100644 index 000000000..98f41ead8 --- /dev/null +++ b/.github/workflows/dotnet-format.yml @@ -0,0 +1,20 @@ +name: Format check on pull request +on: pull_request + +jobs: + dotnet-format: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Add dotnet-format problem matcher + uses: xt0rted/dotnet-format-problem-matcher@v1 + + - name: Restore dotnet tools + uses: xt0rted/dotnet-tool-restore@v1 + + - name: Run dotnet format + uses: xt0rted/dotnet-format@v1 + with: + only-changed-files: true