Skip to content

feat(fix-workflow): decide on auto-merge vs human-review for CoCo fix PRs #1

Description

@sfc-gh-ksampath

Context

The cortex-fix.yml workflow currently runs gh pr merge --squash --auto --delete-branch
immediately after creating the fix PR. This means AI-generated security/bug fixes can
land in main with no human review if branch protection rules allow it.

The question

Should the scaffold default to:

  1. Open PR only — remove --auto, human reviews and merges. Safest.
    Suitable for: security fixes, logic changes, any multi-file patch.

  2. Auto-merge with score threshold — only auto-merge if the fix is
    low-risk (single file, small diff, high-confidence scan result).
    Requires scoring/classification logic in the workflow.

  3. Draft PR — open as draft by default, forcing conscious human
    promotion before merge is possible.

  4. Configurable — scaffold asks during step 4 which policy the user wants.
    Store in manifest, write to workflow env var.

Current leaning

Option 1 (open PR only) as the safe default. Auto-merge can be an opt-in
for users who understand the risk and have sufficient branch protection and CI
checks in place to gate it.

Related

  • can_approve_pull_request_reviews permission (separate from PR creation)
  • Branch protection rule timing (see companion issue/discussion)
  • Step 4 sets default_workflow_permissions=write to enable PR creation

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions