pr.yaml: write protected config files as UTF-8 without BOM#339
Merged
Conversation
The "Fetch trusted configuration files from main branch" step writes .editorconfig / Directory.Build.props / BannedSymbols.txt / *.globalconfig / *.ruleset back to disk via `Out-File -Encoding UTF8`. In PowerShell, that encoding name writes UTF-8 *with* a BOM. The .NET analyzer engine that reads .editorconfig appears to silently ignore files that begin with a BOM, which means the project's severity overrides (e.g. `dotnet_diagnostic.MA0002.severity = suggestion`) don't apply on CI even though they apply locally — analyzers fire at their default severity instead. This was diagnosed against In-memory-Logger PR #32 / run 24996715587: local Release builds were clean while CI reported MA0002, MA0049, S2365, etc. as errors. After repointing the build to the BOM-free version of .editorconfig, the same source compiled clean. Switch to `Out-File -Encoding UTF8NoBOM` (PowerShell 6+; GitHub-hosted `shell: pwsh` runners use PS 7+ so this is supported). Four sites in the two "Fetch trusted configuration files" blocks. Downstream consumers will pick up the fix the next time they run their template-sync. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the workflow’s “Fetch trusted configuration files from main branch” step to write protected config files as UTF-8 without a BOM, preventing .NET analyzer configuration files (e.g., .editorconfig) from being ignored on CI due to BOM-prefixed content.
Changes:
- Replaced
Out-File -Encoding UTF8withOut-File -Encoding UTF8NoBOMat four workflow call sites. - Keeps existing
-NoNewlinebehavior while ensuring analyzer configuration files remain BOM-free.
This was referenced May 9, 2026
Merged
Merged
Closed
Closed
Closed
Closed
Closed
Merged
pr.yaml: write protected config files as UTF-8 without BOM
Chris-Wolfgang/Extensions-Logging-Data#27
Closed
Closed
Merged
Chris-Wolfgang
added a commit
that referenced
this pull request
May 9, 2026
Each of test-linux-core, test-windows, test-macos-core, and security-scan ran the "Fetch trusted configuration files from main branch" step twice back-to-back with identical content (modulo trailing whitespace). Drop the second occurrence in all four jobs so the protected configs are restored once per job, not twice. Net effect: 192 lines deleted, no behavior change — second copy was a no-op since main's configs are already on disk after the first run. The single remaining occurrence per job retains the same UTF8NoBOM encoding behavior introduced in #339. Flagged by Copilot review on the downstream backport Chris-Wolfgang/ETL-FixedWidth#90 (which this fixes at the canonical source so every Wolfgang.* repo picks it up on the next sync).
Chris-Wolfgang
added a commit
that referenced
this pull request
May 10, 2026
Each of test-linux-core, test-windows, test-macos-core, and security-scan ran the "Fetch trusted configuration files from main branch" step twice back-to-back with identical content (modulo trailing whitespace). Drop the second occurrence in all four jobs so the protected configs are restored once per job, not twice. Net effect: 192 lines deleted, no behavior change — second copy was a no-op since main's configs are already on disk after the first run. The single remaining occurrence per job retains the same UTF8NoBOM encoding behavior introduced in #339. Flagged by Copilot review on the downstream backport Chris-Wolfgang/ETL-FixedWidth#90 (which this fixes at the canonical source so every Wolfgang.* repo picks it up on the next sync).
This was referenced May 10, 2026
Merged
Chris-Wolfgang
added a commit
to Chris-Wolfgang/String-Extensions
that referenced
this pull request
May 10, 2026
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>
Chris-Wolfgang
added a commit
to Chris-Wolfgang/DbContextBuilder
that referenced
this pull request
May 10, 2026
Backport of [repo-template#339](Chris-Wolfgang/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 `.editorconfig` files, so project severity overrides don't apply on CI — analyzers fire at default severity and `TreatWarningsAsErrors` escalates findings that pass locally. This is a 4-line workflow-only change: `UTF8` → `UTF8NoBOM` at the four call sites. PowerShell 6+ supports the encoding token; `shell: pwsh` runners use PS 7+, so it's safe. Diagnosed against [In-memory-Logger PR #32 / run 24996715587](https://github.com/Chris-Wolfgang/In-memory-Logger/actions/runs/24996715587/job/73195928572). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Chris-Wolfgang
added a commit
to Chris-Wolfgang/ETL-Csv
that referenced
this pull request
May 12, 2026
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>
Chris-Wolfgang
added a commit
to Chris-Wolfgang/D20-Dice
that referenced
this pull request
May 12, 2026
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>
Chris-Wolfgang
added a commit
to Chris-Wolfgang/DateTime-Extensions
that referenced
this pull request
May 12, 2026
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>
Chris-Wolfgang
added a commit
to Chris-Wolfgang/ETL-Json
that referenced
this pull request
May 14, 2026
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>
Chris-Wolfgang
added a commit
to Chris-Wolfgang/ETL-Transformers
that referenced
this pull request
May 14, 2026
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>
Chris-Wolfgang
added a commit
to Chris-Wolfgang/ETL-FixedWidth
that referenced
this pull request
May 14, 2026
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>
Chris-Wolfgang
added a commit
to Chris-Wolfgang/ETL-Xml
that referenced
this pull request
May 14, 2026
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>
Chris-Wolfgang
added a commit
to Chris-Wolfgang/ETL-Test-Kit
that referenced
this pull request
May 14, 2026
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>
Chris-Wolfgang
added a commit
to Chris-Wolfgang/Etl-DbClient
that referenced
this pull request
May 16, 2026
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>
Chris-Wolfgang
added a commit
to Chris-Wolfgang/ETL-Transformers
that referenced
this pull request
Jun 19, 2026
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>
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.
Summary
The "Fetch trusted configuration files from main branch" step in
pr.yaml(in both the v3 gated workflow's main-tests job and the secondary tests job) writes the protected config files back to disk via:In PowerShell,
-Encoding UTF8writes UTF-8 with a BOM. The .NET analyzer engine that reads.editorconfigappears to silently ignore files that begin with a BOM — so the project's severity overrides (e.g.dotnet_diagnostic.MA0002.severity = suggestion) don't apply on CI even though they apply locally. Analyzers fire at their default severity instead, andTreatWarningsAsErrorsthen escalates them.This was diagnosed against Chris-Wolfgang/In-memory-Logger PR #32 / run 24996715587: local Release builds were clean while CI reported MA0002, MA0049, S2365, S1066, MA0158, S1481, S2699 as errors. After repointing the build to the BOM-free version of
.editorconfig, the same source compiled clean.Fix
Switch the four call sites to
Out-File -Encoding UTF8NoBOM. PS 6+ supports this encoding token; GitHub-hostedshell: pwshrunners use PowerShell 7+, so it's safe.Downstream impact
The bug exists in every consumer repo's
pr.yaml. They'll pick up the fix on their next template-sync. No retroactive flush needed — once the BOM-free.editorconfiglands onmain, subsequent PRs will see the analyzer config applied as intended.Test plan
.editorconfigmarks assuggestion🤖 Generated with Claude Code