← Back to Pull requests

Document Actions event policy steps for public PR previews #821

Closed
unknown closed this pull request without merging on Nov 24, 2026 15:17 UTC
View on GitHub
unknown unknown commented on Nov 23, 2026 16:41 UTC
Author

<!-- header-image: skipped (style-none) -->

⊙ Problem

Starting December 2, 2026, GitHub blocks pull_request_target by default in public GitHub.com repositories without an applicable Actions event policy. Harper's PR previews require pull_request_target, so public repos will stop getting previews unless configured. The existing section in learn/developers/deploying-from-ci.mdx gave only a three-step UI stub and omitted allowlist behavior, organization and personal-account scope, Policy insights, REST API automation, and the v5.3 preview path.

💡 Solution

Expanded the public-repository pull_request_target guidance in learn/developers/deploying-from-ci.mdx (the only page here documenting PR-preview workflows):

  • Added a Before you start prerequisite bullet linking to the policy section.

  • Expanded Public repositories: allow pull_request_target with repository UI steps (including personal-account repos), allowlist/default-block behavior, org-level layering, Policy insights, repo/org gh api examples, and the HarperFast/deploy-action@v1 JSON link.

  • Cross-linked the section from Previews on v5.3 for .github/workflows/preview.yml.
  • <details>
    <summary>GitHub Actions event policy findings (from GitHub Docs)</summary>

  • Repository & organization UI path: Settings > Actions > Policies (click Settings, then under Actions click Policies; Policy insights sits directly below it). Enterprise owners configure under Policies > Actions > Policies. (Control workflow execution, About Actions policies)

  • Personal (non-org) account repositories: Supported. Actions policies are available at the repository, organization, and enterprise levels for repository administrators on GitHub.com (Free, Pro, Team, Enterprise Cloud; not GHES). The repository REST endpoint takes any account owner, and active/disabled enforcement works on all plans (evaluate mode is Enterprise-only). (Control workflow execution, Default policy for pull_request_target, Nov 2 changelog)

  • REST API: POST /repos/{owner}/{repo}/actions/policies (repository Administration: write on fine-grained token/App or classic repo scope) and POST /orgs/{org}/actions/policies (organization Administration: write, requiring a repository_name, repository_id, or repository_property condition alongside workflow_path), with header X-GitHub-Api-Version: 2026-03-10, conditions.workflow_path.{include,exclude}, and rule restrict_action_events with allowed_events: ["pull_request_target"]. (REST API endpoints for GitHub Actions policies)
  • </details>

    ⚖️ Alternatives

  • Switch preview workflows to pull_request — rejected; Harper's preview trust model relies on the workflow running from the default branch and OIDC trust policies pin event_name: pull_request_target.

  • Link GitHub's REST docs without inline gh api examples — rejected; a ready-to-run gh api snippet (verified against this repo's live policies) avoids guesswork ahead of the December 2 deadline.
  • 🤔 Keep the inline REST examples and v1 import link?

    Both gh api examples hardcode X-GitHub-Api-Version: 2026-03-10, and the import link targets HarperFast/deploy-action's moving v1 tag; the alternative is linking GitHub's REST reference only. Easy to trim later in a docs edit if you prefer less duplication.

    ✅ Verification

    End-to-end route: full Docusaurus production build plus live verification of external links and GitHub's Actions policy schema (no mutating POST was run against a scratch public repo).

  • npm run format:check, npm run lint, npm run typecheck, npm run test:workflows (30/30 + companion-check), and npm run build (430 docs, static build succeeded with zero MDX or link errors).

  • Verified all five cited external URLs return HTTP 200, including HarperFast/deploy-action@v1 examples/preview-actions-policy.json, and checked git show 62139d54:learn/developers/deploying-from-ci.mdx for the v5.3 recipe's .github/workflows/preview.yml + pull_request_target trigger.

  • Verified the endpoint path, X-GitHub-Api-Version: 2026-03-10 header, and live policy schema via gh api against HarperFast/documentation active policies 11321 (.github/workflows/preview.yaml) and 13664 (.github/workflows/companion-check.yaml).
  • <sub>🤖 Generated by Google Gemini; posted via @kriszyp.</sub>

    Related PRs: none found
    Complexity: easy

    <!-- review-deferrals:start -->

    Accepted behavior

    Behavior the owner ruled intended, so there is nothing to file.

    <details><summary>4 minor or nit</summary>

  • acd14963276be19f minor reliability — .github/workflows/companion-check.yaml — This public repo's own pull_request_target workflows need an Actions event policy from Dec 2 — accepted: Already satisfied on HarperFast/documentation: repository admins created active Actions event policies 11321 (Allow Harper previews, .github/workflows/preview.yaml) on 2026-11-05 and 13664 (Companion Check, .github/workflows/companion-check

  • f65065683974d3c3 minor documentation — learn/developers/deploying-from-ci.mdx — REST policy endpoint, body schema and API version not shown to have been run — accepted: Verified by author during task execution against GitHub REST docs (docs.github.com/en/rest/actions/policies) and live active policies 11321/13664 on HarperFast/documentation via gh api -H X-GitHub-Api-Version: 2026-03-10; no scratch public

  • def12826dd5ffe64 minor documentation — learn/developers/deploying-from-ci.mdx — Importable deploy-action policy JSON at v1 not confirmed to exist or match the inline JSON — accepted: Verified live by author via GitHub API and curl HTTP 200: examples/preview-actions-policy.json exists at HarperFast/deploy-action@v1 and matches the inline JSON (active, .github/workflows/preview.yaml, restrict_action_events pull_request_ta

  • 7f0833495e32da39 nit documentation — learn/developers/deploying-from-ci.mdx — v5.3 cross-link: recipe's trigger not confirmed to be pull_request_target — accepted: Verified directly by author from git show 62139d54:learn/developers/deploying-from-ci.mdx (lines 361-395): the v5.3 recipe adds .github/workflows/preview.yml triggered on pull_request_target.
  • </details>
    <!-- review-deferrals:end -->

    <!-- dispatch-provenance -->
    <details>
    <summary>Origin — the dispatch brief this PR was written from</summary>

    In HarperFast/documentation, add a section to learn/developers/deploying-from-ci.mdx (and any other page describing PR previews) explaining that public repos must allow pull_request_target for the preview workflow via an Actions event policy from Dec 2, 2026, with the exact steps and doc link.

    Acceptance

    Docs build passes; companion-check expectations respected. Draft PR.

    </details>

    <sub>Dispatch: task documentation-preview-prt-policy · queued by kris-session · ran by gemini/gemini-4-neon-high/low · worker kris-mac-m3-fleet-18b9c6</sub>
    <!-- /dispatch-provenance -->

    <sub>Ready-For-Promotion: 2a31a6a9ddfb urgency=normal late=none</sub>

    <sub>Review-Coverage: authored=gemini; ran=cursor-composer,claude; adjudicated=domain; declined=cursor-grok,muse; rounds=4; full=2 @ 2a31a6a9ddfb</sub>

    <sub>Review-Attention: skim ~2m (decisions: reject-pull-request-switch, inline-org-rest-example, inline-rest-example, explicit-repo-placeholder, external-json-pinned-v1, recheck-disputed-179511a9, recheck-disputed-220dd90b) @ 2a31a6a9ddfb</sub>

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: Ethan-Arrowood Review duration: 1356m
    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 #821"
    general weight: 0.35
    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%