From 53c7cb2ec02a40a185feea69628f9b683e216dcc Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Fri, 26 Jul 2024 19:15:50 +0200 Subject: [PATCH] Workflows: Check for byte order mark --- .gitea/workflows/test.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/test.yaml b/.gitea/workflows/test.yaml index ec1b8f9..8801bb7 100644 --- a/.gitea/workflows/test.yaml +++ b/.gitea/workflows/test.yaml @@ -2,7 +2,7 @@ name: Test on: push: branches: ["**"] - paths: ["Elwig/**", "Tests/**", "Installer/Files/*.exe"] + paths: ["Elwig/**", "Tests/**", "Installer/Files/*.exe", ".gitea/workflows/test.yaml"] jobs: test: name: Run tests @@ -10,6 +10,19 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 + - name: Check for Byte order marks + shell: powershell + run: | + $pattern = [char]::ConvertFromUtf32(0xFEFF) + $files = git grep -IEl "^$pattern" + if ( $lastexitcode -ne 1 ) { + echo "Files with BOM found:" + echo $files + exit 1 + } else { + echo "No files with BOM found" + exit 0 + } - name: Setup MSBuild uses: microsoft/setup-msbuild@v1.1 - name: Setup NuGet