pr.yaml: write protected config files as UTF-8 without BOM#197
Merged
Chris-Wolfgang merged 1 commit intoMay 10, 2026
Merged
Conversation
Backport of repo-template PR #339. The 'Fetch trusted configuration files from main branch' step writes .editorconfig / Directory.Build.props / BannedSymbols.txt back via 'Out-File -Encoding UTF8' which writes UTF-8 *with* BOM. The .NET analyzer engine appears to ignore .editorconfig files prefixed by a BOM, so project-level severity overrides don't apply on CI even though they apply locally — analyzers fire at default severity and TreatWarningsAsErrors then escalates them to errors. Switch to 'Out-File -Encoding UTF8NoBOM' (PS 6+; the runner uses pwsh). Diagnosed against Chris-Wolfgang/In-memory-Logger PR #32 / run 24996715587. See Chris-Wolfgang/repo-template#339 for the full write-up. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Windows CI workflow step that rehydrates “protected” configuration files from main so those files are written as UTF-8 without a BOM, preventing .editorconfig/analyzer configuration from being ignored on CI.
Changes:
- Switches
Out-Fileencoding fromUTF8toUTF8NoBOMat the four config-copy write sites in the Windows job.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of repo-template#339.
The 'Fetch trusted configuration files from main branch' step writes the protected configs back via
Out-File -Encoding UTF8(BOM-prefixed). The .NET analyzer engine appears to ignore BOM-prefixed.editorconfigfiles, so project severity overrides don't apply on CI — analyzers fire at default severity andTreatWarningsAsErrorsescalates findings that pass locally.This is a 4-line workflow-only change:
UTF8→UTF8NoBOMat the four call sites. PowerShell 6+ supports the encoding token;shell: pwshrunners use PS 7+, so it's safe.Diagnosed against In-memory-Logger PR #32 / run 24996715587.
🤖 Generated with Claude Code