Repository navigation
Fix broker validation of minimal workflow-run repository responses - #10
Merged
Merged
Conversation
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.
The Actions workflow-run response embeds a minimal repository without default_branch. Comparing that missing field with the stored default branch rejected valid broker requests before prepare, failure reporting and publication. The fixture incorrectly reused a full repository response and concealed the mismatch.
Fetch authoritative repository metadata once in the shared privileged broker validation and require its repository ID, owner ID and current default branch to match the snapshot. Remove only the invalid embedded-default-branch comparison. Signed OIDC caller/default-ref/immutable workflow binding, protected caller SHA, installation, run event/path/head/attempt, App actor and exact dispatch-title checks remain intact. Every broker operation uses the same validation; no missing-field fallback is introduced.
The shared Actions fixture now omits default_branch. With that realistic shape the baseline end-to-end test reproduced 403 instead of 200 before the fix. Positive coverage includes prepare, failure, result, stage, rotate, release and native publication. Negative coverage checks default-branch drift, repository/owner IDs, run event/path/head/attempt, human/foreign-App actors and each dispatch-title identity across all seven operations; signed wrong-branch/workflow claims and unprotected/stale callers still fail.
Validation passed: npm run check (132 tests, strict typecheck, lint and build), npm run test:clean, and actual workerd/D1 integration tests. No production state was reset, credentials changed or additional reviews triggered.
A backend-only Worker bundle deployment after approval is sufficient. Keep the trusted reusable workflow pin exactly 4ed6688; no caller, Cloudflare config, D1 migration or OAuth reconnect change is required. Do not merge/deploy automatically. After approval/deployment, verify using a fresh owner-authorized review request, including native GitHub review publication; local mocks are not proof of a successful production review.
Additional verification: 38/38 targeted worker/OIDC/security/store tests and the Wrangler bundle dry-run passed. Both full CI runs passed on 04a8b30: push, pull request. Production review/publication acceptance remains pending the separately approved backend deployment and a fresh authorized request.