pr.yaml: write protected config files as UTF-8 without BOM#90
Merged
Chris-Wolfgang merged 3 commits intoMay 14, 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
Updates the PR CI workflow’s “Fetch trusted configuration files from main branch” PowerShell step to write protected config files as UTF-8 without a BOM, preventing CI analyzer severity regressions caused by BOM-prefixed .editorconfig.
Changes:
- Switch
Out-Fileencoding fromUTF8toUTF8NoBOMat the four protected-config write sites in the workflow. - Ensures copied
.editorconfig/build config files are interpreted correctly by .NET analyzers during CI runs.
Chris-Wolfgang
added a commit
to Chris-Wolfgang/repo-template
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
to Chris-Wolfgang/repo-template
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).
repo-template#346 merged the dedupe of the doubled "Fetch trusted configuration files from main branch" step that this PR's Copilot review flagged, plus added the missing Dependabot guard to the test-windows variant. Replace pr.yaml with the canonical version so this repo picks up: - 4 duplicate fetch steps removed (one per affected job). - test-windows fetch step now has `if: github.event.pull_request.user.login != 'dependabot[bot]'` for parity with the other jobs. Net effect: 192 lines deleted, no behavior change to the protection logic itself (the first run was already complete after one fetch).
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
Originally a narrow backport of repo-template#339 (UTF-8 BOM fix for protected-config writes). After review feedback on this PR, the branch was re-synced from canonical `repo-template` so it now carries every `pr.yaml` improvement landed upstream since the initial backport:
Why
Test plan