chore(deps): update github actions (major) #712
This file contains 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: Code Formatting | |
on: | |
pull_request: | |
jobs: | |
format-csharp: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 | |
with: | |
ref: ${{ github.ref }} | |
- name: Install .NET Core | |
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4 | |
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@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4 | |
if: ${{ failure() && steps.check-diff.conclusion == 'failure' }} | |
with: | |
name: patch-csharp | |
path: ./patch-csharp.diff |