Skip to content

Add protected-files guard to detect-projects job#59

Merged
Chris-Wolfgang merged 1 commit into
mainfrom
chore/add-protected-files-guard
Apr 29, 2026
Merged

Add protected-files guard to detect-projects job#59
Chris-Wolfgang merged 1 commit into
mainfrom
chore/add-protected-files-guard

Conversation

@Chris-Wolfgang

Copy link
Copy Markdown
Owner

Summary

Adds the protected-files guard to the detect-projects job in pr.yaml:

  1. Fetch trusted configuration files from main branch — copies workflow / Directory.Build.props / .editorconfig / etc. from main so subsequent CI steps run against the trusted versions, not the PR's.
  2. 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.yaml and 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

  • PRs that don't touch .github/workflows/*, Directory.Build.props, etc. are unaffected.
  • PRs that DO touch them will fail this job with a clear maintainer-review prompt — the same ergonomics every other repo on this template has.
  • Dependabot is exempted (its protected-file bumps are legitimate and trustworthy).

Test plan

  • CI passes on this PR (this PR itself touches pr.yaml, so the guard self-trips on first install — CI will fail on Detect .NET Projects. Maintainer reviews the diff and merges.)

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>
@Chris-Wolfgang Chris-Wolfgang merged commit 54c248e into main Apr 29, 2026
8 checks passed
@Chris-Wolfgang Chris-Wolfgang deleted the chore/add-protected-files-guard branch April 29, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant