<commit_before>#!/bin/bash
set -e

# Print Travis environment variables.
echo "TRAVIS_PULL_REQUEST: ${TRAVIS_PULL_REQUEST}"
echo "TRAVIS_TAG: ${TRAVIS_TAG}"
echo "TRAVIS_BRANCH: ${TRAVIS_BRANCH}"

# Only act if this is build was fired from a push to master.
if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ -z "${TRAVIS_TAG}" ] && [ "${TRAVIS_BRANCH}" = "master" ] && [ -n "${gh_bot_token+isset}" ]
then
    # Configure git user.
    setup_git() {
        git config --global user.email "<EMAIL>"
        git config --global user.name "Deployment Bot"
    }
    
    # Commit all changes to local production branch.
    commit_all_files() {
        git checkout -b production
        git add -A
        git commit --message "Travis Build: ${TRAVIS_BUILD_NUMBER}"
    }
    
    # Push changes to remote production branch.
    push_files() {
        git remote add origin https://${gh_bot_token}@github.com/WikipediaLibrary/TWLight.git > /dev/null 2>&1
        git push --quiet --set-upstream-to origin/production
    }

    setup_git
    commit_all_files
    push_files
    echo "Build pushed to production."
else
    echo "Doesn't meet conditions for deployment. Skipping push to production."
fi<commit_msg>travis and my local env aren't on similar versions of git.<commit_after>#!/bin/bash
set -e

# Print Travis environment variables.
echo "TRAVIS_PULL_REQUEST: ${TRAVIS_PULL_REQUEST}"
echo "TRAVIS_TAG: ${TRAVIS_TAG}"
echo "TRAVIS_BRANCH: ${TRAVIS_BRANCH}"

# Only act if this is build was fired from a push to master.
if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ -z "${TRAVIS_TAG}" ] && [ "${TRAVIS_BRANCH}" = "master" ] && [ -n "${gh_bot_token+isset}" ]
then
    # Configure git user.
    setup_git() {
        git config --global user.email "<EMAIL>"
        git config --global user.name "Deployment Bot"
    }
    
    # Commit all changes to local production branch.
    commit_all_files() {
        git checkout -b production
        git add -A
        git commit --message "Travis Build: ${TRAVIS_BUILD_NUMBER}"
    }
    
    # Push changes to remote production branch.
    push_files() {
        git remote add origin https://${gh_bot_token}@github.com/WikipediaLibrary/TWLight.git > /dev/null 2>&1
        git push --quiet origin production
    }

    setup_git
    commit_all_files
    push_files
    echo "Build pushed to production."
else
    echo "Doesn't meet conditions for deployment. Skipping push to production."
fi
{'fraction_non_alphanumeric': 0.11685116851168512, 'fraction_numerical': 0.0016400164001640015, 'mean_word_length': 3.006568144499179, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '301732', 'n_tokens_mistral': 802, 'n_tokens_neox': 781, 'n_words': 237}