<commit_before>#!/bin/bash

_old_x=+x
[[ $- = *x* ]] && _old_x=-x

set -eu

prog=${0##*/}
progdir=${0%%/*}

if [[ -r $progdir/env.sh ]]; then
    set +x
    source $progdir/env.sh
    set $_old_x
fi

project=${GITHUB_REPOSITORY#*/}
repo_owner=${GITHUB_REPOSITORY%/*}

upload_server=ci-xfer.chtc.wisc.edu
# from "ssh-keyscan -t rsa ci-xfer.chtc.wisc.edu"
hostsig="ci-xfer.chtc.wisc.edu ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDyrceRMLPsOmdtDHxXpfI82snDF0Q9/Z1Mick5zsQK1RyOtNgkyvXM50AJSPPSl0I9JmIxSBxhqcNDcbDz0Kc8tKcA1iGQxp4Ll9z9ZCl60AUq72WwkS1A4z11JjRoYvw1CL8bvoJhk55dcgAz+bXWx/eTwcBsmW80/okNDkdYmtv+QgfUmRP6TjMtIkzvCsXi5x+B4j66yQcLDDYb36EcGyHZqoyLuxkxX0OwS7LuzDfnKxpsV9jlnu3PuJnZOizalqKUpTYc2b83XnfsIYTqoiclmFr89+WuQJG6e/596y/9aVtNacCphdS7u3D+tSoME6OG7xQtZiQfkWvKPicv"



function setup_ssh_to_chtc {
    (
        umask 077
        mkdir -p ~/.ssh
        cat > ~/.ssh/config <<__END__
Host $upload_server
User cibot
PubkeyAuthentication yes
PasswordAuthentication no
GSSAPIAuthentication no
ChallengeResponseAuthentication no
KerberosAuthentication no
__END__
        printf "%s\n" "$hostsig" > ~/.ssh/known_hosts
    )
}

function sftp_to_chtc {
    local ret=0
    local remote_dir=/var/tmp/ci_deploy/$repo_owner/$project
    if [[ $GITHUB_REF =~ ^refs/tags/ ]]; then
        # .../htcondor-ce-v2.3.4
        remote_dir=${remote_dir}-$(tr / _ <<<"${GITHUB_REF##refs/tags/}")
    else
        # .../htcondor-ce-88<commit_msg>Remove unrecognized auth method in GHA<commit_after>#!/bin/bash

_old_x=+x
[[ $- = *x* ]] && _old_x=-x

set -eu

prog=${0##*/}
progdir=${0%%/*}

if [[ -r $progdir/env.sh ]]; then
    set +x
    source $progdir/env.sh
    set $_old_x
fi

project=${GITHUB_REPOSITORY#*/}
repo_owner=${GITHUB_REPOSITORY%/*}

upload_server=ci-xfer.chtc.wisc.edu
# from "ssh-keyscan -t rsa ci-xfer.chtc.wisc.edu"
hostsig="ci-xfer.chtc.wisc.edu ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDyrceRMLPsOmdtDHxXpfI82snDF0Q9/Z1Mick5zsQK1RyOtNgkyvXM50AJSPPSl0I9JmIxSBxhqcNDcbDz0Kc8tKcA1iGQxp4Ll9z9ZCl60AUq72WwkS1A4z11JjRoYvw1CL8bvoJhk55dcgAz+bXWx/eTwcBsmW80/okNDkdYmtv+QgfUmRP6TjMtIkzvCsXi5x+B4j66yQcLDDYb36EcGyHZqoyLuxkxX0OwS7LuzDfnKxpsV9jlnu3PuJnZOizalqKUpTYc2b83XnfsIYTqoiclmFr89+<KEY>"



function setup_ssh_to_chtc {
    (
        umask 077
        mkdir -p ~/.ssh
        cat > ~/.ssh/config <<__END__
Host $upload_server
User cibot
PubkeyAuthentication yes
PasswordAuthentication no
GSSAPIAuthentication no
ChallengeResponseAuthentication no
__END__
        printf "%s\n" "$hostsig" > ~/.ssh/known_hosts
    )
}

function sftp_to_chtc {
    local ret=0
    local remote_dir=/var/tmp/ci_deploy/$repo_owner/$project
    if [[ $GITHUB_REF =~ ^refs/tags/ ]]; then
        # .../htcondor-ce-v2.3.4
        remote_dir=${remote_dir}-$(tr / _ <<<"${GITHUB_REF##refs/tags/}")
    else
        # .../htcondor-ce-88
{'fraction_non_alphanumeric': 0.1316916488222698, 'fraction_numerical': 0.04675231977159172, 'mean_word_length': 4.249063670411985, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 8, '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': '7109809', 'n_tokens_mistral': 1471, 'n_tokens_neox': 1349, 'n_words': 150}