← Back to Pull requests

fix(workflows): ignore outsiders' pull requests in shared release automation #811

Closed
unknown closed this pull request without merging on Dec 01, 2026 12:39 UTC
View on GitHub
unknown unknown commented on Nov 30, 2026 14:20 UTC
Author

Summary: Shared release and package-update automations used to look for their official proposal by branch name alone, which meant an outsider could open a proposal from their own copy of a project with the same name and trick the automation into editing or queuing it instead of the real one. This change makes those automations ignore proposals coming from outside copies, so only the project's own release and package-update proposals are updated or queued. This resolves the security finding about release automation mistaking an outsider's proposal for the official one (#810).

What I need from you: Review and approve.

---

What does this change?

Closes #810

Filters cross-repository (fork) pull requests out of all three head-branch PR lookups identified in #810:

  • .github/workflows/reusable-promote-squash.yml ("Upsert promotion PR"): request isCrossRepository in --json number,isCrossRepository and filter with --jq '[.[] | select(.isCrossRepository | not)][0].number // empty'.

  • .github/workflows/reusable-promote-squash.yml ("Rebuild squash promotion branch", queue-entry guard): widen GraphQL pullRequests(...) from first: 1 to first: 20, request isCrossRepository in nodes, and filter with --jq '[.data.repository.pullRequests.nodes[] | select(.isCrossRepository | not)][0] // empty'.

  • .github/workflows/reusable-pkg-cadence.yml ("Commit cadence files and open a PR"): request isCrossRepository in --json number,isCrossRepository and filter with -q '[.[] | select(.isCrossRepository | not)][0].number // empty'.

  • .github/zizmor.yml: advance the secrets-inherit baseline pin on reusable-promote-squash.yml from line 545 to 546 to match the added GraphQL field line.

  • docs/skills/factory-operations.md: update the queue-entry guard snippet and document the isCrossRepository filter rule for head-branch PR lookups.

  • tests/bats/test_pr_lookup_fork_filter.bats: add bats regression tests that run the real workflow step scripts against a field-projecting gh mock and fail if any of the three lookups drops isCrossRepository, select(.isCrossRepository | not), or first: 20.
  • Verification

  • bats --print-output-on-failure tests/bats/test_pr_lookup_fork_filter.bats — 6 passed, 0 failed

  • bats --print-output-on-failure tests/bats/test_promote_squash_queue_guard.bats tests/bats/test_promote_squash_tree_diff.bats — 12 passed, 0 failed

  • Mutation verification: temporarily reverting each of the 7 filter components (upsert jq filter, upsert --json field, queue-guard jq filter, queue-guard GraphQL field, queue-guard first: 20 -> first: 1, cadence jq filter, cadence --json field) caused test_pr_lookup_fork_filter.bats to fail in all 7/7 cases

  • python3 -m pytest tests/ --ignore=tests/bats -q — 1343 passed (including test_zizmor_baseline_pins.py, test_promote_gate_order.py, test_pkg_cadence_intervals.py, and test_skill_spec_conformance.py)

  • node --test tests/node/.test.mjs — 11 passed

  • python3 scripts/check-consumer-contract.py --verbose — 23 required inputs verified

  • python3 scripts/check-self-repository-references.py — passed
  • Consumer validation

    Required for consumer-facing composites and reusable workflows. Production uses managed @v1; a reviewed first-party candidate source is permitted only in the read-only onboarding preview.

    Consumer PR: https://github.com/projectbluefin/common/pull/1774
    Consumer CI run: https://github.com/projectbluefin/common/actions/runs/46503675795
    Out-of-org consumer impact: Safe — ublue-os/aurora and ublue-os/bazzite are unaffected because no inputs, outputs, or Justfile contracts change; callers using reusable-promote-squash.yml or reusable-pkg-cadence.yml only ignore cross-repository fork PRs when matching same-repo automation branches.

  • Opened a consumer PR using @v1 production references (read-only candidate preview only when bootstrapping)

  • Linked a passing consumer CI run that exercised this change (empty-commit consumer PR; Build set build_required=false and skipped every projectbluefin/actions step, and the changed reusable workflows are not PR-triggered in consumers)

  • Evaluated out-of-org consumers (ublue-os/aurora, ublue-os/bazzite) and documented the impact above
  • Consumer note: projectbluefin/bluefin is archived (read-only), so projectbluefin/common#1774 is an empty-commit validation PR (/hold, not for merge) that produced green first-party consumer Actions runs (Build #46503675795 and Unit Tests #46503675930). .github/workflows/build.yml in projectbluefin/common uses SHA-pinned projectbluefin/actions/bootc-build/ composite actions (@4f9610973b53c5318e5ea35d089aa11afb70c744 # v1), and neither Build nor Unit Tests calls a reusable workflow, so these runs do not exercise the moving @v1 tag or execute the reusable-promote-squash.yml / reusable-pkg-cadence.yml steps changed in this PR (neither workflow is PR-triggered in consumers). Because the commit is empty, Build set build_required=false and skipped every projectbluefin/actions step, so the run executed no projectbluefin/actions code. The behavioral change is verified by tests/bats/test_pr_lookup_fork_filter.bats and the existing reusable-promote-squash bats tests in this repo. Close projectbluefin/common#1774 once this PR lands.

    Checklist

  • I am using an agent and I take responsibility for this PR (if AI-assisted)

  • Conventional commit message (feat:, fix:, chore:, etc.)

  • No hardcoded secrets or credentials
  • -- hive: backend=agy

    ---
    🐝 Hive Agent: contributor | SHA: 2ec4773

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: Danathar Review duration: 1338m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #811"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%