Skip to the content.

GitHub CSharpier Linter Action

[![GitHub repo](https://img.shields.io/badge/GitHub-guibranco%2Fgithub--csharpier--linter--action-green.svg?style=flat-square&logo=github)](https://github.com/guibranco/github-csharpier-linter-action) [![GitHub last commit](https://img.shields.io/github/last-commit/guibranco/github-csharpier-linter-action?color=green&logo=github&style=flat-square&label=Last%20commit)](https://github.com/guibranco/github-csharpier-linter-action) [![GitHub license](https://img.shields.io/github/license/guibranco/github-csharpier-linter-action?color=green&logo=github&style=flat-square&label=License)](https://github.com/guibranco/github-csharpier-linter-action) ![CI](https://github.com/guibranco/github-csharpier-linter-action/actions/workflows/ci.yml/badge.svg) [![wakatime](https://wakatime.com/badge/github/guibranco/github-csharpier-linter-action.svg)](https://wakatime.com/badge/github/guibranco/github-csharpier-linter-action)

πŸ“‹ Overview

A GitHub Action to automatically check and enforce C# code formatting using CSharpier. This action helps maintain clean code by running formatting checks and posting annotations, job summaries, and PR comments when issues are detected.

πŸ›  Features

🧩 Usage

You can use this action in your workflows by referencing it as a reusable workflow:

jobs:
  linter-check:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
    steps:
      - name: CSharpier Linter
        uses: guibranco/github-csharpier-linter-action@v1.0.5

⚑ Requirements

πŸ“ Outputs

πŸ’‘ Example Workflow

Here’s an example workflow that uses this action:

name: Linter check

on:
  workflow_dispatch:
  pull_request:

jobs:
  linter-check:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: write
    steps:
      - name: CSharpier Linter
        uses: guibranco/github-csharpier-linter-action@v1.0.5

πŸ”§ How It Works

  1. Setup .NET: Ensures that .NET SDK is installed.
  2. Run CSharpier: Runs dotnet csharpier check . and checks for any formatting issues.
  3. Create Annotations and PR Comments: If issues are found, the action creates inline annotations, a job summary, and a comment on the PR.

πŸ›  Development

To contribute to this action:


πŸš€ Installation & Contribution

πŸ† License

This project is licensed under the MIT License - see the LICENSE file for details.