Skip to content

Question: YAML key ordering in compiled steps differs from source #13656

@dunalduck0

Description

@dunalduck0

Question

When using steps: in a workflow markdown file, the compiled lock.yml reorders the YAML keys alphabetically, resulting in a different order than the source file.

Source (deeptest-ubuntu.md)

`yaml
steps:

  • name: Run DeepTest Agent
    run: |
    gh copilot --agent DeepTest ...
    env:
    COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
    `

Order:
ame →
un → �nv

Compiled output (deeptest-ubuntu.lock.yml)

yaml - env: COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }} name: Run DeepTest Agent run: gh copilot --agent DeepTest ...

Order: �nv →
ame →
un

Other steps in the same file

Other steps generated by the compiler use the conventional order (
ame → �nv →
un), for example:
yaml - name: Configure Git credentials env: REPO_NAME: ${{ github.repository }} run: | git config ...

Question

Is this alphabetical reordering of user-provided steps intentional? While YAML doesn't require a specific key order and GitHub Actions will execute correctly either way, the inconsistency between user-provided steps and compiler-generated steps is noticeable.

Should we expect the compiler to preserve the original key order, or is alphabetical sorting the intended behavior?

Environment

  • gh-aw version: 0.38.2
  • OS: Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions