From 189d14a9022169f625181cdb71b1b929d1b834b0 Mon Sep 17 00:00:00 2001 From: Artem Goncharov Date: Tue, 10 Sep 2024 10:58:24 +0200 Subject: [PATCH] Escape commit message When generated content is being commited it uses the same commit message as for the change triggered it. It is possible that quotes in the original change break syntax for the `git commit` command and therefore need to be escaped properly. Use ansible `quote` filter. Change-Id: Ia71aef06aea9355fb99c6d4bca5288ec14f78814 --- playbooks/rust/all.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/rust/all.yaml b/playbooks/rust/all.yaml index b20a683..79a0d01 100644 --- a/playbooks/rust/all.yaml +++ b/playbooks/rust/all.yaml @@ -64,7 +64,7 @@ - name: "Commit changes" ansible.builtin.command: - cmd: "git commit -m 'feat: New generated content' -m '{{ zuul.change_message }}' -m 'Changes are triggered by {{ zuul.change_url }}'" + cmd: "git commit -m 'feat: New generated content' -m {{ zuul.change_message | quote }} -m 'Changes are triggered by {{ zuul.change_url }}'" chdir: "{{ rust_project_dir }}" register: "commit" when: