Skip to content

Commit

Permalink
Merge pull request #94 from seionmoya/initial-ci-formatter
Browse files Browse the repository at this point in the history
Run formatter on pushing to dev
  • Loading branch information
seionmoya authored Nov 13, 2024
2 parents bb46725 + d3af6ba commit db5110c
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/dotnet-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: .NET Format

on:
push:
branches:
- 'dev'
paths:
- '**.cs'
- '**.yml' # assume ci/cd pipeline changes

jobs:
format:
runs-on: windows-latest

permissions:
contents: write

env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: .NET restore
run: dotnet restore --nologo --configfile Nuget.config

- name: .NET clean
run: dotnet clean --nologo

- name: .NET format
run: dotnet format --no-restore

- name: Push changes
run: |
git config user.name "github-actions[bot]"
git config user.email "170472707+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "[skip CI] CI/CD: format code"
git push
File renamed without changes.

0 comments on commit db5110c

Please sign in to comment.