Skip to content

[plan] Create workflow patterns library with top 10 templates #8060

@github-actions

Description

@github-actions

Objective

Analyze 172 production workflows to identify top 10 most common patterns and create template starters for each, addressing the current 5.8% example-to-production ratio gap.

Context

Currently only 10 example workflows exist for 172 production workflows (5.8% ratio). Developers struggle to find relevant examples for their use case. The largest workflow is 744 lines, suggesting complexity that could benefit from templates. With 48 shared fragments already in use, there's a foundation for reusability that needs better discovery.

Approach

  1. Analyze all 172 workflows in .github/workflows/*.md
  2. Categorize by trigger type, tools used, and safe-outputs
  3. Identify top 10 patterns by frequency and usefulness (e.g., auto-labeler, PR reviewer, issue responder, discussion handler, code scanning, etc.)
  4. Create examples/patterns/ directory
  5. Create template workflow for each pattern with:
    • Inline documentation explaining each section
    • Common customization points marked with # TODO: Customize this
    • Links to related examples and documentation
    • Estimated complexity level (beginner, intermediate, advanced)
  6. Create examples/patterns/README.md as pattern directory/index
  7. Update main README.md to link to pattern library

Template Example Structure

---
# Pattern: Auto-Labeler Based on PR Content
# Complexity: Beginner
# Use Case: Automatically label PRs based on file changes or description keywords
---

name: Auto Label PRs
on:
  pull_request:
    types: [opened, edited]

engine: copilot

tools:
  github:
    mode: remote

safe_outputs:
  add_labels:
    # TODO: Customize labels based on your repository
    labels: ["needs-review"]

# Agent Instructions
Analyze the pull request:
1. Check which files were changed
2. Look for keywords in title and description
3. Apply appropriate labels:
   - "documentation" if docs/ files changed
   - "bug" if title contains "fix" or "bug"
   - "feature" if title contains "add" or "new"

# Related Examples
- See examples/label-trigger-simple.md for simpler labeling
- See examples/label-trigger-pull-request.md for advanced PR handling

Files to Create/Modify

  • Create: examples/patterns/ directory
  • Create: 10 new pattern template files (e.g., auto-labeler.md, pr-reviewer.md, etc.)
  • Create: examples/patterns/README.md (index with when to use each pattern)
  • Update: README.md (link to pattern library)

Acceptance Criteria

  • All 172 workflows analyzed and categorized by pattern
  • Top 10 patterns identified by frequency and usefulness
  • examples/patterns/ directory created with 10 template workflows
  • Each template includes inline documentation, customization points, and complexity level
  • Each template links to related examples and documentation
  • examples/patterns/README.md created as pattern index
  • Main README.md updated to link to pattern library
  • Example coverage ratio improved from 5.8% toward target of >10%

AI generated by Planning Assistant for #7631
Related to #8056

AI generated by Plan Command for discussion #7631

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions