<commit_before># cut latest tag - based on changelog
# issue a GitHub release
function release {
  # get tag and release notes from changelog
  FILE=CHANGELOG.md
  MESSAGES=()
  BODY=""
  k=1
  while read line; do
    if [[ $k = 1 ]]; then
      # capture release version - for tag
      RELEASE="$line"
      RELEASE=${RELEASE:3}
    elif [ -z "$line" ]; then
      # stop on previous release
      break
    else
      # keep change for tag
      MESSAGES+=("-m \"$line\"")
      BODY+="$line\n"
    fi

    ((k++))
  done < $FILE

  # annotated tag and messages
  TAG="git tag -a v$RELEASE -m \"v$RELEASE\""
  ANNOTATIONS="${MESSAGES[@]}"

  # issue tag and push
  COMMAND="${TAG} ${ANNOTATIONS}"
  eval $COMMAND
  git push origin --tags

  # create GitHub release
  RELEASE_JSON="{\"tag_name\": \"v${RELEASE}\", \"target_commitish\": \"master\", \"name\": \"v${RELEASE}\", \"body\": \"${BODY}\"}"

  # issue github release
  curl --data "$RELEASE_JSON" -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/b-lab-org/impact-app/releases?access_token=$GH_ACCESS_TOKEN
}

# TODO deploy application
# already auto-deployed to Heroku - instead do other build processes.
function deploy {
  echo "not yet implemented"
}

#!/bin/bash
if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
  release
  deploy
fi<commit_msg>fixing typo in deploy script<commit_after># cut latest tag - based on changelog
# issue a GitHub release
function release {
  # get tag and release notes from changelog
  FILE=CHANGELOG.md
  MESSAGES=()
  BODY=""
  k=1
  while read line; do
    if [[ $k = 1 ]]; then
      # capture release version - for tag
      RELEASE="$line"
      RELEASE=${RELEASE:3}
    elif [ -z "$line" ]; then
      # stop on previous release
      break
    else
      # keep change for tag
      MESSAGES+=("-m \"$line\"")
      BODY+="$line\n"
    fi

    ((k++))
  done < $FILE

  # annotated tag and messages
  TAG="git tag -a v$RELEASE -m \"v$RELEASE\""
  ANNOTATIONS="${MESSAGES[@]}"

  # issue tag and push
  COMMAND="${TAG} ${ANNOTATIONS}"
  eval $COMMAND
  git push origin --tags

  # create GitHub release
  RELEASE_JSON="{\"tag_name\": \"v${RELEASE}\", \"target_commitish\": \"master\", \"name\": \"v${RELEASE}\", \"body\": \"${BODY}\"}"

  # issue github release
  curl --data "$RELEASE_JSON" -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/jonpitch/danger-brewing/releases?access_token=$GH_ACCESS_TOKEN
}

# TODO deploy application
# already auto-deployed to Heroku - instead do other build processes.
function deploy {
  echo "not yet implemented"
}

#!/bin/bash
if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
  release
  deploy
fi
{'fraction_non_alphanumeric': 0.1613372093023256, 'fraction_numerical': 0.0029069767441860465, 'mean_word_length': 3.1398496240601506, 'pattern_counts': {'":': 8, '<': 5, '<?xml version=': 0, '>': 3, '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': '2792647', 'n_tokens_mistral': 976, 'n_tokens_neox': 904, 'n_words': 267}