Skip to content

Commit 7c4da9a

Browse files
committed
feat: run pre-commit install if package is installed or updated
1 parent 94e52f4 commit 7c4da9a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

etc/kayobe/ansible/install-pre-commit-hooks.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
name: pre-commit
1111
version: 3.5.0
1212
virtualenv: "{{ lookup('ansible.builtin.env', 'VIRTUAL_ENV') }}"
13+
register: pip_install
1314

1415
- name: Register pre-commit hooks with git
1516
ansible.builtin.command:
1617
cmd: "{{ lookup('ansible.builtin.env', 'VIRTUAL_ENV') }}/bin/pre-commit install"
17-
creates: "{{ lookup('ansible.builtin.env', 'KAYOBE_CONFIG_PATH') }}/../../.git/hooks/pre-commit"
1818
args:
1919
chdir: "{{ lookup('ansible.builtin.env', 'KAYOBE_CONFIG_PATH') }}"
20+
when: pip_install is changed

0 commit comments

Comments
 (0)