Pixeval/.github/workflows/check-xaml-formatting.yml
Το μοχθηρό ^_^ 2e1c620d64
chore: update workflows and package dependencies (#566)
* Add renovate.json

* Update dependency CommunityToolkit.Labs.WinUI.TitleBar to 0.0.1-build.1830

* Update NuGet/setup-nuget action to v1.2.0

* Update dependency CommunityToolkit.Labs.WinUI.TitleBar to 0.0.1-build.1924

* Update microsoft/setup-msbuild action to v1.3

* Update NuGet/setup-nuget action to v2

* Update actions/cache action to v4

* Update actions/checkout action to v4

* Update actions/setup-dotnet action to v4

* Update microsoft/setup-msbuild action to v2

* Delete renovate.json

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-26 16:14:05 +08:00

49 lines
1.1 KiB
YAML

name: Check XAML Formatting
on:
workflow_dispatch:
push:
branches:
- 'main'
- 'service/**'
paths:
- '**.xaml'
pull_request:
branches:
- 'main'
- 'service/**'
paths:
- '**.xaml'
jobs:
check-formatting:
runs-on: ubuntu-latest
defaults:
run:
shell: pwsh
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Install Xaml Styler
run: |
dotnet tool install --global XamlStyler.Console
- name: Check Formatting
id: check-step
run: |
$changedFiles = (git diff --diff-filter=d --name-only HEAD~1) -split "\n" | Where-Object {$_ -like "*.xaml"}
foreach ($file in $changedFiles)
{
xstyler -p -l None -f $file
if ($LASTEXITCODE -ne 0)
{
echo "::error file=$file::Format check failed"
}
}
continue-on-error: true
- name: Fail job if necessary
if: steps.check-step.outcome == 'failure'
run: exit 1