Skip to content

chore: Pin SDK version #5147

chore: Pin SDK version

chore: Pin SDK version #5147

Workflow file for this run

name: "Format Code"
on:
pull_request:
jobs:
format-code:
name: Format Code
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
with:
submodules: recursive
- name: Format C, C++, Objective-C and header files
run: >
find samples/. -type f
-name "*.h"
-o -name "*.c"
-o -name "*.cpp"
-o -name "*.m"
| xargs clang-format -i -style=file
- name: Install .NET SDK
if: runner.os != 'Windows'
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4
with:
global-json-file: global.json
- name: Restore .NET Workload
run: dotnet workload restore
- name: Format C# Code Whitespace
run: dotnet format whitespace Sentry.Unity.sln --exclude src/sentry-dotnet --verbosity diag
# actions/checkout fetches only a single commit in a detached HEAD state. Therefore
# we need to pass the current branch, otherwise we can't commit the changes.
# GITHUB_HEAD_REF is the name of the head branch. GitHub Actions only sets this for PRs.
- name: Commit Formatted Code
run: ./scripts/commit-formatted-code.sh $GITHUB_HEAD_REF