Skip to content
check-circle

GitHub Action

dotnet-format on Pull Request

v1 Latest version

dotnet-format on Pull Request

check-circle

dotnet-format on Pull Request

Run dotnet-format on Pull Request

Installation

Copy and paste the following snippet into your .yml file.

              

- name: dotnet-format on Pull Request

uses: tsubakimoto/action-dotnet-format@v1

Learn more about this action in tsubakimoto/action-dotnet-format

Choose a version

action-dotnet-format

dotnet-format for GitHub Actions

Usage

See action.yml

Basic:

steps:
  - uses: actions/checkout@v4
  - uses: actions/setup-dotnet@v4
    with:
      dotnet-version: '8.0.x'
  - uses: tsubakimoto/action-dotnet-format@v1
    with:
      base-branch: ${{ github.ref_name }}
      project-path: 'example.csproj'
      verbosity: 'diag'
      github-token: ${{ secrets.GITHUB_TOKEN }}

Permissions

The GITHUB_TOKEN secret is required to create a pull request.

Permission Value
contents write
pull_requests write

License

The scripts and documentation in this project are released under the MIT License