Make generated command script execution robust #5

Open
opened 2026-05-03 06:21:54 +00:00 by lambadalambda · 0 comments

Problem

Command steps hit a known failure mode where generated shell execution failed with errors like:

/bin/sh: syntax error: unterminated quoted string

This matched upstream reports around command entrypoint/script handling. We had to work around it by overriding the entrypoint and writing CI_SCRIPT to a file before executing it:

printf "%s" "$CI_SCRIPT" | base64 -d > /tmp/ci-script.sh && /bin/sh -xe /tmp/ci-script.sh

Desired behavior

Woodpecker should execute generated command scripts in a way that is robust for larger or more complex scripts by default. For example:

  • write the decoded script to a file and execute that file
  • avoid piping decoded script directly through shell in a way that can be truncated or quoting-sensitive
  • preserve useful xtrace/error behavior
  • document the exact generated wrapper behavior

Why this matters

Command execution is core CI functionality. Users should not need custom entrypoints across many workflows to avoid intermittent shell quoting/truncation issues.

## Problem Command steps hit a known failure mode where generated shell execution failed with errors like: ```text /bin/sh: syntax error: unterminated quoted string ``` This matched upstream reports around command entrypoint/script handling. We had to work around it by overriding the entrypoint and writing `CI_SCRIPT` to a file before executing it: ```sh printf "%s" "$CI_SCRIPT" | base64 -d > /tmp/ci-script.sh && /bin/sh -xe /tmp/ci-script.sh ``` ## Desired behavior Woodpecker should execute generated command scripts in a way that is robust for larger or more complex scripts by default. For example: - write the decoded script to a file and execute that file - avoid piping decoded script directly through shell in a way that can be truncated or quoting-sensitive - preserve useful xtrace/error behavior - document the exact generated wrapper behavior ## Why this matters Command execution is core CI functionality. Users should not need custom entrypoints across many workflows to avoid intermittent shell quoting/truncation issues.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pleroma/woodpecker#5
No description provided.