Skip to content

Feature: support explicit custom key for close-older matching #21028

@strawgate

Description

@strawgate

Problem

close-older-issues currently dedupes/closures based on workflow markers (gh-aw-workflow-id / gh-aw-workflow-call-id).

For reusable workflows invoked via workflow_call, multiple caller workflows in the same repo can still collide when marker identity is not unique enough for the caller context. We observed issues from different caller workflows closing each other.

Recent history suggests this area is sensitive:

The current behavior makes it hard for users to guarantee isolated close-older streams per logical workflow.

Proposal

Add an optional explicit custom key for close-older matching.

Suggested config

For create-issue and create-discussion, support something like:

safe-outputs:
  create-issue:
    close-older-issues: true
    close-older-key: "my-stable-dedupe-key"

(Equivalent field for discussions.)

Semantics

  • If close-older-key is set:
    • emit marker: <!-- gh-aw-close-key: <value> -->
    • use this marker as the primary key for close-older selection
  • If not set:
    • preserve existing behavior and marker precedence (backward compatible)

Why this helps

  • Gives users deterministic isolation across caller workflows
  • Works even if caller identity inference changes over time
  • Lets teams intentionally set the key to title prefix (or any convention) when desired, while still using exact marker matching in bodies instead of fuzzy title search

Backward compatibility

No behavior change for existing workflows unless close-older-key is provided.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions