Skip to content

[plan] Codemod: lowercase discussion-category values in workflow source #31846

Description

@github-actions

Objective

Add a codemod that lowercases discussion_comment / discussion trigger category strings in workflow frontmatter source, so source matches the runtime-normalized form.

Context

From compatibility audit issue #31667. Observed in Z3Prover/z3 with 11 occurrences. gh-aw normalizes Agentic Workflowsagentic workflows at compile time silently. Over time the source file drifts from what the workflow actually matches, causing confusion.

Approach

  1. Find where discussion-category normalization (lowercasing) happens at compile time (search for discussion trigger handling and ToLower/lowercase in pkg/workflow/ and pkg/parser/)
  2. Add a codemod (in the gh aw fix pipeline or as a default-on codemod) that:
    • Scans on.discussion.types, on.discussion_comment.types, or any frontmatter field holding discussion category strings
    • Lowercases any mixed-case category values in-place in the source file
  3. Since this is low-risk (compiler already normalizes at compile time), it can be a default-on codemod (no opt-in flag needed)
  4. Add tests covering: mixed-case input lowercased, already-lowercase is a no-op

Files to Investigate

  • pkg/workflow/ — search for toLower, strings.ToLower, discussion trigger handling
  • pkg/cli/fix_command.go — codemod entry point
  • pkg/parser/ — frontmatter parsing for discussion triggers

Acceptance Criteria

  • gh aw fix --write lowercases discussion category strings (e.g. Agentic Workflowsagentic workflows)
  • Already-lowercase values are unchanged (no-op)
  • Source file after fix matches what the compiler uses at runtime
  • Tests cover the detection and rewrite logic

Generated by Plan Command · ● 3.8M ·

  • expires on May 15, 2026, 2:35 AM UTC

Metadata

Metadata

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