Skip to content

dispatch-workflow / call-workflow: findWorkflowFile never checks the .yaml extension #49178

Description

@blozano-tt

Summary

dispatch-workflow’s same-repo workflow resolution (findWorkflowFile in pkg/workflow/dispatch_workflow_file_resolver.go) only builds candidate paths for .md, .lock.yml, and .yml. It never checks .yaml, so a plain, hand-written GitHub Actions workflow using the (equally valid, very common) .yaml extension can never be referenced as a dispatch-workflow target by its bare name — compilation fails with “workflow not found” even though the file exists and has a workflow_dispatch trigger.

Reproduction

Repo layout:

.github/workflows/target.yaml # plain GH Actions workflow, has on: workflow_dispatch:
.github/workflows/caller.md # gh-aw workflow
caller.md frontmatter:

safe-outputs:
dispatch-workflow:
workflows: [target]
Run:

gh aw compile

Expected

Compilation succeeds; target.yaml is resolved and validated the same way target.yml would be.

Actual

dispatch-workflow: workflow 'target' not found in .github/workflows

Checked for: target.md, target.lock.yml, target.yml

To fix:

  1. Verify the workflow file exists in .github/workflows/
  2. Ensure the filename matches exactly (case-sensitive)
  3. Use the filename without extension in your configuration
    Note the checked list omits .yml’s equally-valid sibling extension, .yaml.

Root cause

In findWorkflowFile (same file):

mdPath := filepath.Clean(filepath.Join(searchDir, workflowName+".md"))
lockPath := filepath.Clean(filepath.Join(searchDir, workflowName+".lock.yml"))
ymlPath := filepath.Clean(filepath.Join(searchDir, workflowName+".yml"))
No .yaml candidate is ever constructed. The “not found” error text in pkg/workflow/dispatch_workflow_validation.go:65 mirrors the same three-extension list, so the message is internally consistent — it’s just missing a fourth branch.

I traced this while wiring up a dispatch-workflow target against a real-world repo (tenstorrent/tt-metal) where every hand-written CI workflow uses .yaml (not .yml) by convention — this isn’t a hypothetical edge case, it blocks the feature entirely for any repo that standardized on the .yaml spelling.

Suggested fix

Add a fourth candidate, .yaml, alongside the existing .yml check in findWorkflowFile (and the corresponding existence flag / error message), mirroring how GitHub Actions itself treats .yml/.yaml as interchangeable for workflow files. call-workflow (pkg/workflow/call_workflow_validation.go) calls this exact same findWorkflowFile function, so it has the identical gap — fixing findWorkflowFile fixes both call sites at once.

Environment

gh-aw version: v0.84.0 (also confirmed present on main @ 6d65f8a as of 2026-07-30)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions