-
Notifications
You must be signed in to change notification settings - Fork 317
Description
Context
From issue #23282 (finding 4): The create_issue handler has a title_prefix config option that auto-prepends the prefix to every created issue title. This is intentional for branding/namespacing.
However, operators who want to enforce that the agent provides titles matching a prefix (rather than silently fixing them) have no mechanism to do so. The close_issue handler already has a required_title_prefix option that gates/rejects operations where the title doesn't match — but create_issue lacks an equivalent.
Objective
Add a required_title_prefix option to the create_issue safe-output handler. When set, the handler should reject (skip with warning) any create_issue request where the agent-provided title does not already start with the required prefix, instead of auto-prepending.
This mirrors the existing pattern in close_issue.cjs and close_entity_helpers.cjs.
Files to Modify
actions/setup/js/create_issue.cjs— Addrequired_title_prefixconfig option. If set, check the agent-provided title; if it doesn't start with the prefix, skip with acore.warning()message (consistent with close_issue behavior).actions/setup/js/create_issue.test.cjs— Add tests for:required_title_prefixrejects issue with non-matching title (emits warning, skips)required_title_prefixallows issue with matching titletitle_prefixstill auto-prepends as before (existing behavior unchanged)- Both options can coexist (but document the precedence)
docs/src/content/docs/reference/safe-outputs-specification.md— Document bothtitle_prefix(auto-prepend) andrequired_title_prefix(gate/enforcement) and the distinction between them.
Approach
In create_issue.cjs, after reading config.title_prefix, also read config.required_title_prefix. Before creating the issue:
const requiredTitlePrefix = config.required_title_prefix || "";
if (requiredTitlePrefix && !item.title.startsWith(requiredTitlePrefix)) {
core.warning(`Skipping create_issue: title "${item.title}" does not start with required prefix "${requiredTitlePrefix}"`);
return { success: false, skipped: true, error: `Title does not match required prefix` };
}This is consistent with how close_entity_helpers.cjs enforces required_title_prefix.
Acceptance Criteria
-
required_title_prefixskips creation when title doesn't match, emitting a clear warning -
required_title_prefixallows creation when title matches -
title_prefixauto-prepend behavior is unchanged - Tests cover both accept and reject scenarios for
required_title_prefix - Spec documentation clarifies the distinction between
title_prefix(auto-prepend) vsrequired_title_prefix(enforcement/gate)
Reference
Issue #23282 (smoke-test finding 4)
Related to #23282
Generated by Plan Command for issue #23282 · ◷
- expires on Mar 30, 2026, 1:53 AM UTC