51 lines
1.4 KiB
YAML
51 lines
1.4 KiB
YAML
name: .NET Format
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- develop
|
|
pull_request:
|
|
branches-ignore:
|
|
- main
|
|
|
|
jobs:
|
|
dotnet-format:
|
|
if: "!contains(github.event.head_commit.message, '.NET Format Style Fixes')"
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.BYPASS_WORKFLOW_PAT || github.token }}
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: 9.0
|
|
|
|
- name: Restore Tool Dependencies
|
|
run: dotnet tool install -g csharpier
|
|
|
|
- name: CSharpier Format
|
|
run: csharpier format .
|
|
|
|
- name: Check PR Formatting
|
|
if: github.event_name == 'pull_request'
|
|
run: |
|
|
if [[ -n $(git status --porcelain) ]]; then
|
|
echo "::error::Code formatting issues found. Please run 'csharpier format .' locally and push the changes to your PR branch. Read the 'README.md' file for more information."
|
|
git status --porcelain
|
|
exit 1
|
|
fi
|
|
|
|
- name: Auto Commit Changes (Push)
|
|
if: github.event_name != 'pull_request'
|
|
uses: stefanzweifel/git-auto-commit-action@v6
|
|
with:
|
|
commit_message: .NET Format Style Fixes
|
|
commit_user_name: sp-tarkov-bot
|
|
commit_user_email: singleplayertarkov@gmail.com
|
|
commit_author: sp-tarkov-bot <singleplayertarkov@gmail.com>
|