Skip to content

[Bug]: Workflow names contain leading spaces breaking CLI usage #2150

@SteveKrisjanovsD365

Description

@SteveKrisjanovsD365

AL-Go Bug Report: Workflow names contain leading spaces breaking CLI usage

AL-Go version

v8.2

Describe the issue

Many AL-Go workflow files have names that begin with a leading space character, making them incompatible with GitHub CLI (gh) workflow commands. This breaks automation scripts and CLI-based workflows.

Affected workflows in AL-Go AppSource template:

  • CI/CD (space before CI/CD)
  • Publish To Environment (space before Publish)
  • Create release (space before Create)
  • Create Online Dev. Environment (space before Create)
  • Test Current (space before Test)
  • Deploy Reference Documentation (space before Deploy)
  • Increment Version Number (space before Increment)
  • Test Next Major (space before Test)
  • Test Next Minor (space before Test)
  • Publish To AppSource (space before Publish)
  • Update AL-Go System Files (space before Update)

Not affected (no leading space):

  • Add existing app or test app
  • Create a new app
  • Create a new performance test app
  • Create a new test app
  • Pull Request Build
  • Troubleshooting
  • _Build AL-Go project

The inconsistency suggests this was unintentional.

Why this is a problem

1. GitHub CLI incompatibility

The gh CLI tool is the official GitHub command-line interface and is widely used for automation. When workflow names contain leading spaces, CLI commands fail:

# This fails:
gh workflow run "CI/CD" --ref main

# Error:
# could not find any workflows named CI/CD

# This works, but is unintuitive:
gh workflow run " CI/CD" --ref main

Users must discover through trial and error that workflows have hidden leading spaces. The GitHub web UI provides no visual indication that spaces exist in workflow names.

2. Breaks automation scripts

DevOps scripts that trigger AL-Go workflows programmatically must hardcode the leading space:

# Fragile - space is invisible in code
gh workflow run " Publish To Environment" --ref epic/hotfix `
    -f environmentName=UAT `
    -f appVersion=latest

If AL-Go later fixes the workflow names (removes spaces), all automation scripts break.

3. Inconsistent with GitHub conventions

GitHub's own workflows and examples do not use leading spaces in workflow names. AL-Go's inconsistency with platform conventions makes the framework harder to learn and use.

4. No visual indication

The leading space is invisible in:

  • GitHub Actions UI
  • Workflow run logs
  • gh workflow list output (appears as normal indentation)
  • Code editors (easy to accidentally remove during edits)

Users have no way to know the space exists without reading the YAML source files directly.

Steps to reproduce

  1. Create an AL-Go for GitHub AppSource repository using v8.2 template
  2. Install GitHub CLI (gh)
  3. Authenticate: gh auth login
  4. List workflows: gh workflow list
    • Observe output shows workflows with apparent leading spaces
  5. Attempt to trigger CI/CD workflow:
    gh workflow run "CI/CD" --ref main
  6. Observe error: could not find any workflows named CI/CD
  7. Try with leading space:
    gh workflow run " CI/CD" --ref main
  8. Observe workflow triggers successfully

Expected behavior

Workflow names should not contain leading or trailing whitespace. This aligns with:

  • GitHub's workflow naming conventions
  • CLI tool expectations
  • Standard software naming practices

Expected workflow names:

  • CI/CD (no space)
  • Publish To Environment (no space)
  • Create Release (no space)
  • etc.

Actual behavior

Workflow YAML files define names with leading spaces:

Example from .github/workflows/CICD.yaml:

name: ' CI/CD'

Example from .github/workflows/PublishToEnvironment.yaml:

name: ' Publish To Environment'

Example from .github/workflows/CreateRelease.yaml:

name: ' Create release'

The space character is intentional in the YAML source but serves no functional purpose and breaks CLI compatibility.

Impact on users

Real-world scenario

A development team uses AL-Go for continuous deployment. Their DevOps pipeline includes:

  1. Developer merges code to epic branch
  2. CI/CD script automatically triggers "Publish To Environment" workflow via gh CLI
  3. Script fails with "could not find any workflows named Publish To Environment"
  4. Developer spends 30+ minutes debugging
  5. Developer discovers leading space exists through trial and error
  6. Developer updates all automation scripts to include invisible leading space
  7. Future AL-Go updates may break scripts if spaces are removed

This wastes developer time and reduces confidence in AL-Go automation.

Affected use cases

  • CI/CD pipelines: Automated workflow triggering via GitHub CLI
  • Release automation: Scripts that orchestrate multi-step release processes
  • Environment management: Scripts that deploy to multiple environments sequentially
  • Integration testing: Workflows that trigger AL-Go builds from external systems

Additional context

Comparison with standard GitHub workflows

GitHub's own workflow examples:

name: CI
name: Deploy to Production
name: Release

AL-Go workflows:

name: ' CI/CD'
name: ' Publish To Environment'
name: ' Create release'

GitHub does not use leading spaces in any official examples or documentation.

Why leading spaces may have been added

Possible original intent:

  • Visual separation in GitHub UI workflow list (but this doesn't work - spaces are invisible)
  • Sorting/grouping workflows alphabetically (but this is fragile and doesn't work as intended)

Neither use case justifies breaking CLI compatibility.

Suggested fix

Remove leading spaces from all AL-Go workflow names:

Before:

name: ' CI/CD'

After:

name: 'CI/CD'

This change should be applied to:

  • AL-Go for GitHub AppSource template
  • AL-Go for GitHub PTE template
  • All AL-Go system workflow files

Breaking change considerations

This is technically a breaking change for users who have hardcoded the leading space in automation scripts. However:

  1. The current behavior is already broken (doesn't work with CLI)
  2. Most users likely don't use CLI triggering due to this bug
  3. The fix aligns with platform conventions
  4. Users can easily update scripts (remove space from workflow name string)

Recommended migration:

  1. Document the change in AL-Go release notes
  2. Provide clear before/after examples
  3. Update AL-Go documentation to show correct workflow names
  4. Consider adding workflow name validation to AL-Go template linter

Verification after fix

After removing leading spaces, verify:

gh workflow list
# Should show: CI/CD, Publish To Environment, etc. (no leading spaces)

gh workflow run "CI/CD" --ref main
# Should succeed without requiring leading space

Related issues

This issue is separate from but related to:

All three issues stem from AL-Go workflows not following standard GitHub/PowerShell/CLI conventions and best practices.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions