https://github.com/guibranco/github-csharpier-linter-action
π― A reusable GitHub Action to automatically check and enforce C# code formatting using CSharpier
https://github.com/guibranco/github-csharpier-linter-action
Last synced: 26 days ago
JSON representation
π― A reusable GitHub Action to automatically check and enforce C# code formatting using CSharpier
- Host: GitHub
- URL: https://github.com/guibranco/github-csharpier-linter-action
- Owner: guibranco
- Created: 2025-04-28T19:53:33.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-09-02T07:27:21.000Z (about 1 month ago)
- Last Synced: 2025-09-02T09:23:15.795Z (about 1 month ago)
- Homepage: http://guilherme.stracini.com.br/github-csharpier-linter-action/
- Size: 44.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GitHub CSharpier Linter Action
[](https://github.com/guibranco/github-csharpier-linter-action)
[](https://github.com/guibranco/github-csharpier-linter-action)
[](https://github.com/guibranco/github-csharpier-linter-action)

[](https://wakatime.com/badge/github/guibranco/github-csharpier-linter-action)## π Overview
A **GitHub Action** to automatically check and enforce **C# code formatting** using **[CSharpier](https://csharpier.com/)**. This action helps maintain clean code by running formatting checks and posting annotations, job summaries, and PR comments when issues are detected.
## π Features
- **Automatic formatting check**: Uses `dotnet csharpier check .` to validate the formatting of all C# files.
- **Job summary**: Uploads a neat, easy-to-read summary in the GitHub Actions interface.
- **Inline annotations**: Adds warnings in the code where formatting is incorrect.
- **PR comments**: Posts a comment on the pull request with the list of issues detected.## π§© Usage
You can use this action in your workflows by referencing it as a reusable workflow:
```yaml
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
- **C#** files should be part of your repository.
- Make sure your repository has `.cs` files, `.csproj`, or similar files that are relevant to the format.## π Outputs
- **Job summary**: Available in the PR Checks section, clearly summarizing the formatting issues.
- **Annotations**: Warning annotations are placed on the lines where formatting issues are found.
- **PR Comments**: An easy-to-read comment posted directly on the PR.## π‘ Example Workflow
Hereβs an example workflow that uses this action:
```yaml
name: Linter checkon:
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:
- Clone the repository and test locally.
- Make sure to follow best practices for creating GitHub Actions.---
### π Installation & Contribution
- Clone this repo to use in your own workflows.
- Feel free to open issues or submit pull requests to improve the action!## π License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.