Skip to content

[plan] Add required_title_prefix enforcement option to create_issue safe-output handler #23302

@github-actions

Description

@github-actions

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 — Add required_title_prefix config option. If set, check the agent-provided title; if it doesn't start with the prefix, skip with a core.warning() message (consistent with close_issue behavior).
  • actions/setup/js/create_issue.test.cjs — Add tests for:
    • required_title_prefix rejects issue with non-matching title (emits warning, skips)
    • required_title_prefix allows issue with matching title
    • title_prefix still 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 both title_prefix (auto-prepend) and required_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_prefix skips creation when title doesn't match, emitting a clear warning
  • required_title_prefix allows creation when title matches
  • title_prefix auto-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) vs required_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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions