Skip to content

Steps using gh aw must always follow extension install (document/clarify in templates and docs) #22110

@mhavelock

Description

@mhavelock

Problem

If a workflow generated by gh-aw places a step using gh aw logs before the extension install, the workflow fails with:

unknown command "aw" for "gh"

This can happen if a user edits the generated workflow or adds new steps without realizing the gh-aw extension is not globally available by default. The main source file for the workflow (.github/workflows/portfolio-analyst.md at https://github.com/github/gh-aw/blob/a0c0a8183fd045c9f3187bda167770d8897bd527/.github/workflows/portfolio-analyst.md) does not currently make this dependency explicit in a visible docstring or comment.

How to Reproduce

  • In a workflow, put a step like this before installing the extension:
    - name: Download logs from last 30 days
      run: gh aw logs ...
    - name: Install gh-aw extension
      run: gh extension install github/gh-aw
  • The workflow will fail when it reaches the first step above.

Suggestion

  • Update documentation in .github/workflows/portfolio-analyst.md and other relevant templates to explicitly warn that all steps depending on gh aw must come after the extension install step.
  • Consider generating workflows or additional comments that highlight this ordering dependency.
  • Optionally, add a pre-step check or code comment to help users avoid this error in the future.

Impact

  • Easy for new users to hit, since the order isn't always obvious.
  • Trivial to fix, but frustrating if you don't realize the requirement.

This issue was originally encountered downstream in mhavelock/anthropicprinciple, but applies to all workflows generated by or derived from gh-aw configs.


Labels: workflow, bug, documentation

Note: I can also clone github/gh-aw to local to assist with any patch or PR if needed.

Metadata

Metadata

Assignees

No one assigned

    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