Add protected-files guard to detect-projects job#59
Merged
Conversation
Adds two steps to the detect-projects job: - 'Fetch trusted configuration files from main branch' copies workflow / Directory.Build.props / .editorconfig / etc. from main so the rest of CI runs against the trusted versions instead of the PR's. - 'Detect protected configuration file changes' fails the job if the PR modified any protected files, requiring maintainer review. Mirrors repo-template's pr.yaml. Closes the gap left when the protected-file detection rollout did not reach this repo before the recent action-upgrade PR was merged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Jun 26, 2026
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
Adds the protected-files guard to the
detect-projectsjob inpr.yaml:Fetch trusted configuration files from main branch— copies workflow /Directory.Build.props/.editorconfig/ etc. frommainso subsequent CI steps run against the trusted versions, not the PR's.Detect protected configuration file changes— fails the job if the PR modified any of those protected files, prompting a maintainer review.Mirrors the existing pattern in
repo-template/pr.yamland the other extension repos that already have the guard.Why this repo was missing it
The "Add .github/workflows/* to protected file detection" rollout that propagated this guard hadn't reached this repo yet. The recent action-upgrade PR merged here without tripping the guard precisely because the guard wasn't installed.
Behavior
.github/workflows/*,Directory.Build.props, etc. are unaffected.Test plan
pr.yaml, so the guard self-trips on first install — CI will fail onDetect .NET Projects. Maintainer reviews the diff and merges.)