Skip to content

chore(deps): update github actions #710

chore(deps): update github actions

chore(deps): update github actions #710

name: Code Formatting
on:
pull_request:
jobs:
format-csharp:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
ref: ${{ github.ref }}
- name: Install .NET Core
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3
with:
dotnet-version: 6.x
- name: Install ReSharper
run: |
dotnet tool install -g JetBrains.ReSharper.GlobalTools --version 2022.2.2
- name: Restore
run: |
dotnet restore ArmoniK.Extensions.Csharp.sln
- name: Reformat
run: |
jb cleanupcode --exclude="**.props" ArmoniK.Extensions.Csharp.sln
- name: Check Diff
id: check-diff
run: |
DIFF="$(git diff --name-only)"
if [ -z "$DIFF" ]; then
echo "OK: Format is clean"
else
echo "Error: Format was not clean"
echo "List of files:"
echo "$DIFF"
git diff
exit 1
fi
- name: Generate patch
if: ${{ failure() && steps.check-diff.conclusion == 'failure' }}
run: |
git diff > patch-csharp.diff
- uses: actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5 # v3
if: ${{ failure() && steps.check-diff.conclusion == 'failure' }}
with:
name: patch-csharp
path: ./patch-csharp.diff