cicd path_handling ai_generated true

upload-artifact fails — path with spaces not properly quoted in GitHub Actions

ID: cicd/github-actions-space-in-path-artifact

Also available as: JSON · Markdown
85%Fix Rate
88%Confidence
4Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
any active

Root Cause

GitHub Actions upload-artifact or cache action fails when path contains spaces or special characters.

generic

Workarounds

  1. 90% success Quote the path and use GitHub Actions expression syntax for dynamic paths
    path: "build output/artifacts"  # YAML quoted string preserves spaces

    Sources: https://github.com/actions/upload-artifact

  2. 88% success Rename output directories to avoid spaces in CI workflow
    run: mv 'build output' build-output  # normalize paths before artifact upload

    Sources: https://github.com/actions/upload-artifact

Dead Ends

Common approaches that don't work:

  1. Escape spaces with backslash in YAML 80% fail

    YAML backslash escaping is inconsistent; most actions parse paths as plain strings

  2. Use shell globbing to match files with spaces 75% fail

    Glob patterns in actions/upload-artifact do not handle spaces in directory names