<commit_before>#!/bin/bash
set -eo pipefail

DEBUG_HOOK=false

function setup-git() {
    echo "===> Configuring credentials"
    git config user.email "<EMAIL>"
    git config user.name "CI"
    mkdir -p ~/.ssh
    echo -e "$DEPLOY_KEY_VIVLIOSTYLE_ORG" | base64 -d > ~/.ssh/deploy-vivliostyle-org.key
    echo -e "$DEPLOY_KEY_VIVLIOSTYLE_GITHUB_IO" | base64 -d > ~/.ssh/deploy-vivliostyle-github-io.key
    chmod 600 ~/.ssh/deploy-vivliostyle-org.key
    chmod 600 ~/.ssh/deploy-vivliostyle-github-io.key
    echo -e "Host github-vivliostyle-org\n\tStrictHostKeyChecking no\nHostName github.com\nIdentityFile ~/.ssh/deploy-vivliostyle-org.key\n" > ~/.ssh/config
    echo -e "Host github-vivliostyle-github-io\n\tStrictHostKeyChecking no\nHostName github.com\nIdentityFile ~/.ssh/deploy-vivliostyle-github-io.key\n" >> ~/.ssh/config
}

function build-archive() {
    echo "===> Generating Viewer Archive"
    archiveDir=${1:-vivliostyle-latest}
    archiveName=${2:-vivliostyle-viewer.zip}
    echo "Generating ${archiveName} from ${archiveDir}"

    mkdir ${archiveDir}
    cp ./CHANGELOG.md ${archiveDir}/
    cp ./packages/viewer/README*.md ${archiveDir}/
    git clone -q --depth=1 --branch=master https://github.com/vivliostyle/docs.vivliostyle.org.git ${archiveDir}/docs
    rm -rf ${archiveDir}/docs/{.git,.gitignore,CNAME}

    mkdir ${archiveDir}/viewer/
    cp -R ./packages/viewer/lib/* ${archiveDir}/viewer/<commit_msg>chore(ci): fix error git config user<commit_after>#!/bin/bash
set -eo pipefail

DEBUG_HOOK=false

function setup-git() {
    echo "===> Configuring credentials"
    git config --global user.email "<EMAIL>"
    git config --global user.name "Vivliostyle (CI)"
    mkdir -p ~/.ssh
    echo -e "$DEPLOY_KEY_VIVLIOSTYLE_ORG" | base64 -d > ~/.ssh/deploy-vivliostyle-org.key
    echo -e "$DEPLOY_KEY_VIVLIOSTYLE_GITHUB_IO" | base64 -d > ~/.ssh/deploy-vivliostyle-github-io.key
    chmod 600 ~/.ssh/deploy-vivliostyle-org.key
    chmod 600 ~/.ssh/deploy-vivliostyle-github-io.key
    echo -e "Host github-vivliostyle-org\n\tStrictHostKeyChecking no\nHostName github.com\nIdentityFile ~/.ssh/deploy-vivliostyle-org.key\n" > ~/.ssh/config
    echo -e "Host github-vivliostyle-github-io\n\tStrictHostKeyChecking no\nHostName github.com\nIdentityFile ~/.ssh/deploy-vivliostyle-github-io.key\n" >> ~/.ssh/config
}

function build-archive() {
    echo "===> Generating Viewer Archive"
    archiveDir=${1:-vivliostyle-latest}
    archiveName=${2:-vivliostyle-viewer.zip}
    echo "Generating ${archiveName} from ${archiveDir}"

    mkdir ${archiveDir}
    cp ./CHANGELOG.md ${archiveDir}/
    cp ./packages/viewer/README*.md ${archiveDir}/
    git clone -q --depth=1 --branch=master https://github.com/vivliostyle/docs.vivliostyle.org.git ${archiveDir}/docs
    rm -rf ${archiveDir}/docs/{.git,.gitignore,CNAME}

    mkdir ${archiveDir}/viewer/
    cp -R ./packages/viewer/lib/* ${archiveDir}/viewer/
{'fraction_non_alphanumeric': 0.15872471717517997, 'fraction_numerical': 0.008913267055193692, 'mean_word_length': 3.566510172143975, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, 'https://': 2, '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': '4018696', 'n_tokens_mistral': 1142, 'n_tokens_neox': 1067, 'n_words': 191}