-
Notifications
You must be signed in to change notification settings - Fork 868
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add verify code styles workflow. (#10450)
* chore: add lint check workflow * chore: remove writing PR comments * chore: modify code formatting (`dotnet format` cause diffs on ubuntu env)
- Loading branch information
Showing
2 changed files
with
46 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: lint | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- ready_for_review | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
if: github.event.pull_request.draft == false | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup .NET SDK | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: | | ||
9.x | ||
- name: Run `dotnet format` command | ||
run: | | ||
dotnet restore | ||
dotnet format --no-restore --verify-no-changes | ||
- name: Report failures as Job Summary | ||
if: ${{ failure() }} | ||
shell: pwsh | ||
run: | | ||
$content = ' | ||
## Failed to run the `lint.yml` workflow | ||
To fix workflow errors. Please follow the steps below. | ||
1. Run `dotnet format` command. | ||
2. Commit changes as separated commit. | ||
3. Push changes to source branch of PR. | ||
' | ||
Write-Output $content >> $env:GITHUB_STEP_SUMMARY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters