<commit_before>require 'base64'

options = {
  GIT_BRANCH: ENV['GIT_BRANCH'],
  GIT_REPOSITORY_URL: ENV['GIT_REPOSITORY_URL'],
  CLONE_DESTINATION_DIR: ENV['CLONE_DESTINATION_DIR'],
  #
  USER_HOME: ENV['HOME'],
  # auth
  AUTH_USER: ENV['AUTH_USER'],
  AUTH_PASSWORD: ENV['AUTH_PASSWORD'],
  AUTH_SSH_PRIVATE_KEY_BASE64: ENV['AUTH_SSH_PRIVATE_KEY_BASE64']
}

p "options: #{options}"

if options[:AUTH_SSH_PRIVATE_KEY_BASE64]
  private_key_file_path = File.join(options[:USER_HOME], './ssh/id_rsa')
  p "private_key_file_path: #{private_key_file_path}"
  private_key_decoded = Base64.decode64(options[:AUTH_SSH_PRIVATE_KEY_BASE64])
  File.open(private_key_file_path, 'wt') { |f| f.write(private_key_decoded) }
  system "chmod 600 #{private_key_file_path}"
end<commit_msg>create .ssh folder if not yet created<commit_after>require 'base64'
require 'fileutils'

options = {
  GIT_BRANCH: ENV['GIT_BRANCH'],
  GIT_REPOSITORY_URL: ENV['GIT_REPOSITORY_URL'],
  CLONE_DESTINATION_DIR: ENV['CLONE_DESTINATION_DIR'],
  #
  USER_HOME: ENV['HOME'],
  # auth
  AUTH_USER: ENV['AUTH_USER'],
  AUTH_PASSWORD: ENV['<PASSWORD>'],
  AUTH_SSH_PRIVATE_KEY_BASE64: ENV['AUTH_SSH_PRIVATE_KEY_BASE64']
}

p "options: #{options}"

if options[:AUTH_SSH_PRIVATE_KEY_BASE64]
  private_key_file_path = File.join(options[:USER_HOME], './ssh/id_rsa')
  p "private_key_file_path: #{private_key_file_path}"
  # create the folder if not yet created
  FileUtils::mkdir_p(File.join(options[:USER_HOME], '.ssh'))
  # private key - save to file
  private_key_decoded = Base64.decode64(options[:AUTH_SSH_PRIVATE_KEY_BASE64])
  File.open(private_key_file_path, 'wt') { |f| f.write(private_key_decoded) }
  system "chmod 600 #{private_key_file_path}"
end
{'fraction_non_alphanumeric': 0.13403263403263405, 'fraction_numerical': 0.019813519813519812, 'mean_word_length': 7.2548076923076925, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '2790627', 'n_tokens_mistral': 728, 'n_tokens_neox': 700, 'n_words': 101}