<commit_before>---

- name: GIT | REPO url
  shell:  "
         gituname='{{capians_git_user}}';
         if [ ! -z $gituname ]; then
          echo '{{capians_git_method}}://{{capians_git_user}}:{{capians_git_pass}}@{{capians_git_repo}}' ;
         else
          echo '{{capians_git_method}}://{{capians_git_repo}}' ;
         fi "
  run_once: true
  register: git_url

- name: GIT | Check git repository
  shell: "
          /bin/bash -c 'set -x ;
          git ls-remote --heads {{git_url.stdout}}' 2>&1 | sed 
                 -e 's|:.*@|:XXXXXX@|g' ; exit  ${PIPESTATUS[0]}
          " 
  run_once: true
  register: git_heads
  ignore_errors: True

- fail: 
     var: git_heads
  when: git_heads|failed

- debug: 
     msg: "{{ git_heads.stdout_lines | regex_replace('\\\\t', ' ') }}"
  run_once: true
  when: git_heads|succeeded
  
  
- name: GIT | Clone/update repo 
  git:
    repo: "{{git_url.stdout}}"<commit_msg>Update git_https.yml<commit_after>---

- name: GIT | REPO url
  shell:  "
         gituname='{{capians_git_user}}';
         if [ ! -z $gituname ]; then
          echo '{{capians_git_method}}://{{capians_git_user}}:{{capians_git_pass}}@{{capians_git_repo}}' ;
         else
          echo '{{capians_git_method}}://{{capians_git_repo}}' ;
         fi "
  run_once: true
  register: git_url

- name: GIT | Check git repository
  shell: "
          /bin/bash -c 'set -x ;
          git ls-remote --heads {{git_url.stdout}}' 2>&1 | sed 
                 -e 's|:.*@|:XXXXXX@|g' ; exit  ${PIPESTATUS[0]}
          " 
  run_once: true
  register: git_heads

- fail: 
     msg: "Git credentials are wrong!"
  when: git_heads|failed

- debug: 
     msg: "{{ git_heads.stdout_lines | regex_replace('\\\\t', ' ') }}"
  run_once: true
  when: git_heads|succeeded
  
  
- name: GIT | Clone/update repo 
  git:
    repo: "{{git_url.stdout}}"
{'fraction_non_alphanumeric': 0.16792656587473, 'fraction_numerical': 0.0032397408207343412, 'mean_word_length': 2.33273381294964, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6596241', 'n_tokens_mistral': 724, 'n_tokens_neox': 679, 'n_words': 135}