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
This commit is contained in:
Artem Goncharov 2024-09-10 10:58:24 +02:00
parent a5332a2072
commit 189d14a902

View File

@ -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: