Skip to content

fix(ci): quote interpolated CI_COMMIT_MESSAGE/AUTHOR/EMAIL settings#48

Open
dschmidt wants to merge 1 commit into
mainfrom
fix/ci-quote-interpolated-message
Open

fix(ci): quote interpolated CI_COMMIT_MESSAGE/AUTHOR/EMAIL settings#48
dschmidt wants to merge 1 commit into
mainfrom
fix/ci-quote-interpolated-message

Conversation

@dschmidt
Copy link
Copy Markdown
Contributor

@dschmidt dschmidt commented May 14, 2026

Conventional commit messages contain a colon after the type (fix(spec): …). When Woodpecker substitutes ${CI_COMMIT_MESSAGE} into the message: ${CI_COMMIT_MESSAGE} setting of push_target_repo, the resulting YAML reads message: fix(spec): … and the strict YAML parser reports mapping values are not allowed in this context.

Wrap the three variable-interpolated values (message, author_name, author_email) in double quotes across all four .woodpecker/build-* pipelines so the substitution stays a single scalar.

Caveat

Woodpecker substitutes before YAML parsing, so this only protects against : (and other YAML-special chars), not against a literal " in the commit message itself. A commit titled fix: handle "weird" case would still break the pipeline. Single-quoting has the same flaw for '. A robust fix would require the wp-git-action plugin to read these values from the environment instead of YAML settings, or a pre-step that sanitises the message into a clean ENV var.

This is the lesser evil: every conventional commit message contains a colon, almost none contain a double quote.

Conventional commit messages contain a colon after the type (`fix(spec):
…`). When Woodpecker substitutes `${CI_COMMIT_MESSAGE}` into the
`message: ${CI_COMMIT_MESSAGE}` setting of `push_target_repo`, the
resulting YAML reads `message: fix(spec): …` and the strict YAML parser
reports `mapping values are not allowed in this context`.

Wrap the three variable-interpolated values (`message`, `author_name`,
`author_email`) in double quotes across all four `.woodpecker/build-*`
pipelines so the substitution stays a single scalar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant