Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions .github/workflows/formatter.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Format

on:

# https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
pull_request_target:
paths:
- '**.editorconfig'
Expand All @@ -16,28 +17,23 @@ jobs:
runs-on: ubuntu-latest

steps:

- name: Setup .NET
uses: actions/setup-dotnet@v4

- name: Install the dotnet-format
# Installing the tool globally to avoid any interference from potentially malicious code checked out in the next step
run: dotnet tool install dotnet-format -g --version 5.1.250801

- name: Checkout repository
uses: actions/checkout@v4
with:
show-progress: false
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}

- name: Cache .NET tools
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: dotnet-tools-${{ runner.os }}-${{ hashFiles('.config/dotnet-tools.json') }}
restore-keys: dotnet-tools-${{ runner.os }}-

- name: Setup .NET
uses: actions/setup-dotnet@v4

- name: Restore tools
run: dotnet tool restore

- name: Format scripts
run: dotnet tool run dotnet-format --fix-whitespace --no-restore
- name: Format scripts
run: dotnet-format --fix-whitespace --no-restore

- name: Set Git config
run: |
Expand Down
Loading