<commit_before>#!/bin/bash

# extracted from: https://gist.github.com/domenic/ec8b0fc8ab45f39403dd

set -e # Exit with nonzero exit code if anything fails


SOURCE_BRANCH="master"
TARGET_BRANCH="master"
TRAVIS_NAME="Travis CI"
REPO=`git config remote.origin.url`
SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:}
SHA=`git rev-parse --verify HEAD`
LAST_COMMIT_AUTHOR=$(git log --format="%an" -1)


if [ "$LAST_COMMIT_AUTHOR" = "$TRAVIS_NAME" ]; then
    echo "Cannot build a Travis commit. Exiting"
    exit 0
fi

# Pull requests and commits to other branches are ignored.
if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "$SOURCE_BRANCH" ]; then
    echo "Ignoring pull request"
    exit 0
fi

# Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc
ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv"
ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR}
ENCRYPTED_IV=${!ENCRYPTED_IV_VAR}
openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in deploy_key.enc -out deploy_key -d
chmod 600 deploy_key
eval `ssh-agent -s`
ssh-add deploy_key

git pull $SSH_REPO $TARGET_BRANCH
git checkout $TARGET_BRANCH
# Run our compile script
./ci/compile.sh

git config user.name "Travis CI"
git config user.email "$COMMIT_AUTHOR_EMAIL"

git status
git add .
git commit -m "Deploy to $TARGET_BRANCH: ${SHA}"

# Now that we're all set up, we can push.
git push $SSH_REPO $TARGET_BRANCH<commit_msg>[#93] - altera usuario utilizado pelo Travis CI<commit_after>#!/bin/bash

# extracted from: https://gist.github.com/domenic/ec8b0fc8ab45f39403dd

set -e # Exit with nonzero exit code if anything fails


SOURCE_BRANCH="master"
TARGET_BRANCH="master"
TRAVIS_NAME="FrontPress Bot"
REPO=`git config remote.origin.url`
SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:}
SHA=`git rev-parse --verify HEAD`
LAST_COMMIT_AUTHOR=$(git log --format="%an" -1)


if [ "$LAST_COMMIT_AUTHOR" = "$TRAVIS_NAME" ]; then
    echo "Cannot build a Travis commit. Exiting"
    exit 0
fi

# Pull requests and commits to other branches are ignored.
if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "$SOURCE_BRANCH" ]; then
    echo "Ignoring pull request"
    exit 0
fi

# Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc
ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key"
ENCRYPTED_IV_VAR="encrypted_${ENCRYPTION_LABEL}_iv"
ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR}
ENCRYPTED_IV=${!ENCRYPTED_IV_VAR}
openssl aes-256-cbc -K $ENCRYPTED_KEY -iv $ENCRYPTED_IV -in deploy_key.enc -out deploy_key -d
chmod 600 deploy_key
eval `ssh-agent -s`
ssh-add deploy_key

git pull $SSH_REPO $TARGET_BRANCH
git checkout $TARGET_BRANCH
# Run our compile script
./ci/compile.sh

git config user.name "FrontPress Bot"
git config user.email "<EMAIL>"

git status
git add .
git commit -m "Deploy to $TARGET_BRANCH: ${SHA}"

# Now that we're all set up, we can push.
git push $SSH_REPO $TARGET_BRANCH
{'fraction_non_alphanumeric': 0.11770657672849916, 'fraction_numerical': 0.013490725126475547, 'mean_word_length': 5.090349075975359, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '308164', 'n_tokens_mistral': 1199, 'n_tokens_neox': 1102, 'n_words': 301}