Skip to content

Commit

Permalink
fix(playbook): git config for dry-run
Browse files Browse the repository at this point in the history
Instead of using git config --global, make the git config commands local to each operator repository. This is then safe to run via test.sh (dry-run).
  • Loading branch information
NickLarsenNZ committed Oct 29, 2024
1 parent 325b7af commit d5a5759
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 0 additions & 8 deletions playbook/playbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@
path: "{{ work_dir }}"
state: directory

- name: Configure git author mail
command:
argv: [git, config, --global, user.email, "{{ author_mail }}"]

- name: Configure git author name
command:
argv: [git, config, --global, user.name, "{{ author_name }}"]

- name: Login to github
command:
argv: [gh, auth, login, --with-token]
Expand Down
10 changes: 10 additions & 0 deletions playbook/update_repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@
register: git_change
failed_when: git_change.rc == 0 # fail when there are no changes

- name: Configure git author mail
command:
argv: [git, config, user.email, "{{ author_mail }}"]
chdir: "{{ work_dir }}/{{ operator.name }}"

- name: Configure git author name
command:
argv: [git, config, user.name, "{{ author_name }}"]
chdir: "{{ work_dir }}/{{ operator.name }}"

- name: "Operator [{{ operator.name }}] stage all changes"
command:
argv: [git, add, .]
Expand Down

0 comments on commit d5a5759

Please sign in to comment.