Skip to content

[refactoring] Create shared/skip-if-issue-open.md for skip-if-match deduplication pattern #30753

@github-actions

Description

@github-actions

Background

36 workflows use the skip-if-match trigger field to avoid creating duplicate issues or PRs when one already exists. The pattern is nearly identical across all of them — a GitHub issues/PR search query that checks for an open issue/PR with the workflow's title prefix. There is currently no shared component abstracting this pattern.

Problem

Every workflow manually constructs the skip-if-match query:

on:
  schedule: daily
  skip-if-match: 'is:issue is:open in:title "[my-workflow]"'

This duplicates intent-level logic across 36 workflows with no standard enforcement. If the query syntax needs updating (e.g., adding a label: filter), each workflow must be individually edited.

Examples of the Pattern

# architecture-guardian.md
skip-if-match: 'is:issue is:open in:title "[architecture-guardian]"'

# breaking-change-checker.md  
skip-if-match: 'is:issue is:open in:title "[breaking-change]"'

# code-scanning-fixer.md
skip-if-match: 'is:pr is:open in:title "[code-scanning-fix]"'

# spec-librarian.md
skip-if-match: 'is:issue is:open in:title "[spec-librarian]"'

18 workflows checked: ab-testing-advisor, architecture-guardian, breaking-change-checker, code-scanning-fixer, code-simplifier, daily-file-diet, daily-rendering-scripts-verifier, daily-safe-output-optimizer, daily-testify-uber-super-expert, dead-code-remover, deployment-incident-monitor, issue-monster, layout-spec-maintainer, refactoring-cadence, slide-deck-maintainer, spec-librarian, ubuntu-image-analyzer, unbloat-docs

Proposed Shared Component

Path: shared/skip-if-issue-open.md

---
# Skip-If-Issue-Open — Prevents workflow re-runs when a matching issue/PR is already open.
# Adds a skip-if-match trigger condition to stop the workflow if an open issue/PR
# with the given title prefix already exists.
#
# Usage:
#   imports:
#     - uses: shared/skip-if-issue-open.md
#       with:
#         title-prefix: "[my-workflow]"
#         kind: issue        # optional: issue or pr (default: issue)

import-schema:
  title-prefix:
    type: string
    required: true
    description: "Title prefix to search for (e.g. '[my-workflow]')"
  kind:
    type: string
    default: issue
    description: "Whether to match open 'issue' or 'pr' (default: issue)"

on:
  skip-if-match: 'is:${{ github.aw.import-inputs.kind }} is:open in:title "${{ github.aw.import-inputs.title-prefix }}"'
---

Note: Implementing this requires verifying that on: fields in shared components are properly merged with the importing workflow's on: block. If not currently supported, this issue tracks both the shared component and the required compiler support.

Estimated Impact

  • Workflows affected: 36
  • Lines saved: 1–3 lines per workflow = 36–108 lines
  • Maintenance benefit: Centralized query syntax; easy to add label: filters or adjust matching strategy

Migration Plan

  1. Verify (or implement) on: merge support for shared components
  2. Create shared/skip-if-issue-open.md
  3. Migrate workflows — replace inline skip-if-match: with:
imports:
  - uses: shared/skip-if-issue-open.md
    with:
      title-prefix: "[my-workflow]"
  1. Recompile and verify compiled output

Priority: Medium — 36 workflows, but compiler support for on: merging may require extra work

Generated by Workflow Skill Extractor · ● 18.4M ·

  • expires on May 9, 2026, 4:52 AM UTC

Metadata

Metadata

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