Repository navigation
Validate mirrored source changes in pull requests - #6160
max-charlamb wants to merge 1 commit into
Conversation
Allow mirror updates from the same-repository automation/sync-cdac and automation/sync-dbi branches. Reject mirrored source and commit-marker edits from other PRs using the official GitHub Script action, without checking out either repository. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6155adde-0566-4a88-8914-7e11146c2997
| name: Validate mirrored sources | ||
|
|
||
| on: | ||
| pull_request: |
There was a problem hiding this comment.
Can we run this metadata-only validator with pull_request_target, keeping the read-only permissions and no-checkout design? With pull_request, a PR can change both a mirrored file and this validator to make the required check pass. We should also add code ownership for /.github/workflows/ and /.github/CODEOWNERS, and require code-owner approval in the main ruleset. That protects changes to the enforcement logic itself.
| name: Validate mirrored sources | ||
|
|
||
| on: | ||
| pull_request: |
There was a problem hiding this comment.
Please include edited alongside opened, synchronize, and reopened so retargeting an existing PR to main runs validation. Otherwise retargeting alone won't trigger it, potentially leaving the required check missing and blocking the PR until another push.
Summary
Validate mirrored sourcesPR check using GitHub's officialactions/github-scriptaction, pinned to a commit.automation/sync-cdacandautomation/sync-dbibranches only when they belong to the same repository; a fork cannot bypass validation by reusing those names.Validation
Repository configuration
After merging, make
Validate mirrored sourcesa required status check in the ruleset formain. This PR only adds the workflow and does not change repository settings.