fix(ci): quote interpolated CI_COMMIT_MESSAGE/AUTHOR/EMAIL settings#48
Open
dschmidt wants to merge 1 commit into
Open
fix(ci): quote interpolated CI_COMMIT_MESSAGE/AUTHOR/EMAIL settings#48dschmidt wants to merge 1 commit into
dschmidt wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Conventional commit messages contain a colon after the type (
fix(spec): …). When Woodpecker substitutes${CI_COMMIT_MESSAGE}into themessage: ${CI_COMMIT_MESSAGE}setting ofpush_target_repo, the resulting YAML readsmessage: fix(spec): …and the strict YAML parser reportsmapping 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 titledfix: handle "weird" casewould 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.