mirror of
https://github.com/ivuorinen/actions.git
synced 2026-01-26 11:34:00 +00:00
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
46 lines
1.3 KiB
YAML
46 lines
1.3 KiB
YAML
---
|
|
# yaml-language-server: $schema=https://json.schemastore.org/github-action.json
|
|
name: 'C# Lint Check'
|
|
description: 'Runs linters like StyleCop or dotnet-format for C# code style checks.'
|
|
author: 'Ismo Vuorinen'
|
|
|
|
branding:
|
|
icon: 'code'
|
|
color: 'blue'
|
|
|
|
inputs:
|
|
dotnet-version:
|
|
description: 'Version of .NET SDK to use.'
|
|
required: false
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Detect .NET SDK Version
|
|
uses: ivuorinen/actions/dotnet-version-detect@main
|
|
with:
|
|
default-version: '7.0'
|
|
|
|
- name: Setup .NET SDK
|
|
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
|
|
with:
|
|
dotnet-version: '${{ steps.detect-dotnet-version.outputs.dotnet-version }}'
|
|
|
|
- name: Install dotnet-format
|
|
shell: bash
|
|
run: dotnet tool install --global dotnet-format --version 7.0.1
|
|
|
|
- name: Run dotnet-format
|
|
shell: bash
|
|
run: |
|
|
set -eo pipefail
|
|
if ! dotnet format --check --report sarif --report-file dotnet-format.sarif; then
|
|
echo "::error::Code formatting issues found. Check the SARIF report for details."
|
|
exit 1
|
|
fi
|
|
|
|
- name: Upload SARIF Report
|
|
uses: github/codeql-action/upload-sarif@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
|
|
with:
|
|
sarif_file: dotnet-format.sarif
|