Skip to content

Gate secret-bearing and PR-code-executing workflows behind a maintainer /approve-ci command #2191

Description

@Adi-204

Motivation

Following #2184, looked at how much of our CI a pull request can reach before a maintainer has looked at it.

The gap

GitHub's built-in "require approval for fork pull requests" setting only applies to pull_request runs from forks. It does not cover pull_request_target, which runs in the base repository context with access to repository secrets — a trigger GitHub's own docs flag as a known risk area. For that class of workflow we currently have no native approval step available.

Proposal (v1)

A /approve-ci PR comment command:

  • A maintainer comments /approve-ci; the command verifies them against a hardcoded maintainer allowlist and applies a ci-approved label
  • A small set of workflows stays skipped until that label is present
  • Approval is sticky for the PR's lifetime — once approved, later pushes run normally
  • Bot-authored PRs (asyncapi-bot, dependabot) bypass the gate, reusing the bot-exclusion conditions these workflows already have

Deliberately minimal: easy to review, easy to revert, room to tighten later.

Candidate workflows

Of 31 workflows, 21 are centrally managed from asyncapi/.github, so this covers locally-owned ones only. Three candidates:

Workflow Reason
manual-netlify-preview.yml pull_request_target with access to repository secrets
pr-testing-with-test-project.yml executes PR-authored code (npm ci, tests)
verify-docs-up-to-date.yml executes PR-authored code (npm ci, docs build)

Explicitly not proposed: lint-pr-title, verify-ai-disclosure, pr-review-checklist, welcome-first-time-contrib, issues-prs-notifications, automerge*, notify-tsc-members-mention. None checks out PR code, and gating them would delay reviewer feedback or leave required checks pending.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Discussion/Q&A

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions