Skip to content

ci-workflow: MEGAREPO_STORE/MEGAREPO_SKIP_MEMBERS printf emits trailing whitespace line into $GITHUB_ENV #627

@schickling-assistant

Description

@schickling-assistant

The ci-workflow helper emits an invalid GITHUB_ENV trailer for MEGAREPO_STORE (and similarly MEGAREPO_SKIP_MEMBERS).

In genie/ci-workflow.ts around line 1149:

printf 'MEGAREPO_STORE=%s\n' "\$MEGAREPO_STORE" >> "\$GITHUB_ENV"

Because the script is embedded in a multi-line TS template literal and ultimately rendered into a YAML run: block, the \n in the JS source becomes an actual newline inside the printf format string. The rendered YAML then looks like:

            printf 'MEGAREPO_STORE=%s
          ' "$MEGAREPO_STORE" >> "$GITHUB_ENV"

printf therefore writes MEGAREPO_STORE=<value>\n to \$GITHUB_ENV — a valid directive followed by an indentation-only line. GitHub Actions parses each non-empty line in \$GITHUB_ENV as an env directive; a whitespace-only trailer can cause Invalid format failures under stricter parsing or when the trailing spaces are preserved by a runner.

Fix

Use either:

  • an unambiguous single-line assignment: echo "MEGAREPO_STORE=\$MEGAREPO_STORE" >> "\$GITHUB_ENV" (matches the pattern used elsewhere in the same file, e.g. `PNPM_STORE_DIR`), or
  • escape the newline so printf — not JS — expands it: printf 'MEGAREPO_STORE=%s\\n' ...

The same pattern applies to the MEGAREPO_SKIP_MEMBERS printf a few lines below.

Context

Flagged by a Codex review on schickling/dotfiles PR #621 (Forge Electron work). CI there is currently green, so the issue is latent in that workflow, but worth fixing upstream to keep \$GITHUB_ENV strictly well-formed.

Posted on behalf of @schickling
  • agent_name: 💨 cl2-mist
  • agent_session_id: 51498441-542a-4ec3-b486-db9bbde795c0
  • agent_tool: Claude Code
  • agent_tool_version: 2.1.118 (Claude Code)
  • agent_runtime: Claude Code 2.1.118 (Claude Code)
  • agent_model: unknown
  • worktree: dotfiles/schickling/2026-04-10-forge-electron
  • machine: mbp2025

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