-
Notifications
You must be signed in to change notification settings - Fork 102
trigger_comment may screw pipelinerun yaml with the the newline #1929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
chmouel
added a commit
to chmouel/pipelines-as-code
that referenced
this issue
Feb 14, 2025
When using `{{ trigger_comment }}` in a PipelineRun YAML, GitHub comments containing newlines (e.g., `/help`) can break YAML parsing due to improper expansion. This change replaces `\r\n` with `\n` in `trigger_comment`, similar to how `pull_requests_labels` are handled. This ensures valid YAML formatting and avoids parser errors. Fixes openshift-pipelines#1929 Signed-off-by: Chmouel Boudjnah <[email protected]>
chmouel
added a commit
to chmouel/pipelines-as-code
that referenced
this issue
Feb 14, 2025
When using `{{ trigger_comment }}` in a PipelineRun YAML, GitHub comments containing newlines (e.g., `/help`) can break YAML parsing due to improper expansion. This change replaces `\r\n` with `\n` in `trigger_comment`, similar to how `pull_requests_labels` are handled. This ensures valid YAML formatting and avoids parser errors. Fixes openshift-pipelines#1929 Signed-off-by: Chmouel Boudjnah <[email protected]>
7 tasks
chmouel
added a commit
to chmouel/pipelines-as-code
that referenced
this issue
Feb 14, 2025
When using `{{ trigger_comment }}` in a PipelineRun YAML, GitHub comments containing newlines (e.g., `/help`) can break YAML parsing due to improper expansion. This change replaces `\r\n` with `\n` in `trigger_comment`, similar to how `pull_requests_labels` are handled. This ensures valid YAML formatting and avoids parser errors. Fixes openshift-pipelines#1929 Signed-off-by: Chmouel Boudjnah <[email protected]>
pipelines-as-code bot
pushed a commit
that referenced
this issue
Feb 14, 2025
When using `{{ trigger_comment }}` in a PipelineRun YAML, GitHub comments containing newlines (e.g., `/help`) can break YAML parsing due to improper expansion. This change replaces `\r\n` with `\n` in `trigger_comment`, similar to how `pull_requests_labels` are handled. This ensures valid YAML formatting and avoids parser errors. Fixes #1929 Signed-off-by: Chmouel Boudjnah <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
when we have a yaml with the
{{trigger_comment}}
expansion variable we may end up with bad yaml:for example this pipelinerun:
if i do a github comment with newlines like this
/help
it will be expanded to this:
and then we get a parser error:
because it's not a yaml anymore..
I suggest we change the trigger_comment to expand the \r\n to real \n the same way we do for pull_requests_labels:
https://pipelinesascode.com/docs/guide/matchingevents/#matching-pipelinerun-to-a-pull-request-labels
and let the user do it from their script... since there is no reliable way to do this and this is prone to bad user input interpolation
The text was updated successfully, but these errors were encountered: