<commit_before>name: CI

# Controls when the action will run.
on:
  # Triggers the workflow on push or pull request events but only for the default branch
  push:
    branches: [ develop ]
  pull_request:
    branches: [ develop ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

jobs:

  pre-commit:
    runs-on: ubuntu-20.04
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2
      - name: Set up python
        uses: actions/setup-python@v2
      - name: Run pre-commit
        uses: pre-commit/action@v2.0.0

  build:
    runs-on: ubuntu-20.04
    needs: pre-commit
    steps:

      - name: Cancel Previous Runs
        uses: styfle/cancel-workflow-action@0.8.0
        with:
          access_token: ${{ github.token }}

      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Setup Java JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11

      # step required for https://github.com/nektos/act/issues/161 to run locally with https://github.com/nektos/act
      - name: Download Maven
        if: ${{ env.ACT }}
        run: |
          apt-get update && apt-get install -y libfontconfig1
          curl -fsSL https://www-eu.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz \
            | tar xz -C /usr/share
          ln -s /usr/share/apache-maven-$MAVEN_VERSION/bin/mvn /usr/bin/mvn
        env:
          MAVEN_VERSION: 3.6.3

      - name: Cache Maven packages
        uses: actions/cache@v2
        with:
          path: ~/.m2
          key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
          restore-keys: ${{ runner.os }}-m2

      - name: Build with Maven
        run: mvn -B verify

      - name: Install jx-release-version
        if: ${{ github.event_name == 'push' }}
        uses: Alfresco/alfresco-build-tools/.github/actions/setup-jx-release-version@v1.1.0

      - name: Bump version with jx-release-version
        if: ${{ github.event_name == 'push' }}
        run: |
          git fetch --tags -q
          echo $(jx-release-version) > VERSION

      - name: Set preview version
        if: ${{ contains(github.head_ref, 'preview') }}
        run: |
          BRANCH_NAME=${GITHUB_HEAD_REF#refs/heads/}
          echo 0.0.1-${BRANCH_NAME/\//-}-${GITHUB_RUN_NUMBER}-SNAPSHOT > VERSION

      - name: Set VERSION env variable
        if: ${{ github.event_name == 'push' || contains(github.head_ref, 'preview') }}
        run: |
          VERSION=$(cat VERSION)
          echo set VERSION=$VERSION
          echo "VERSION=$VERSION" >> $GITHUB_ENV

      - name: Deploy with Maven
        if: ${{ github.event_name == 'push' || contains(github.head_ref, 'preview') }}
        run: |
          mvn -B versions:set -DnewVersion=$VERSION -DprocessAllModules=true -DgenerateBackupPoms=false
          mvn -B -s settings.xml deploy -DskipTests
        env:
          MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
          MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}

      - name: Configure git user
        if: ${{ github.event_name == 'push' }}
        run: |
          git config --global user.name $GITHUB_USERNAME
          git config --global user.email $GITHUB_<EMAIL>
        env:
          GITHUB_USERNAME: ${{ secrets.BOT_GITHUB_USERNAME }}
<commit_msg>Make it explicit we use incremental versions<commit_after>name: CI

# Controls when the action will run.
on:
  # Triggers the workflow on push or pull request events but only for the default branch
  push:
    branches: [ develop ]
  pull_request:
    branches: [ develop ]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

jobs:

  pre-commit:
    runs-on: ubuntu-20.04
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2
      - name: Set up python
        uses: actions/setup-python@v2
      - name: Run pre-commit
        uses: pre-commit/action@v2.0.0

  build:
    runs-on: ubuntu-20.04
    needs: pre-commit
    steps:

      - name: Cancel Previous Runs
        uses: styfle/cancel-workflow-action@0.8.0
        with:
          access_token: ${{ github.token }}

      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Setup Java JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11

      # step required for https://github.com/nektos/act/issues/161 to run locally with https://github.com/nektos/act
      - name: Download Maven
        if: ${{ env.ACT }}
        run: |
          apt-get update && apt-get install -y libfontconfig1
          curl -fsSL https://www-eu.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz \
            | tar xz -C /usr/share
          ln -s /usr/share/apache-maven-$MAVEN_VERSION/bin/mvn /usr/bin/mvn
        env:
          MAVEN_VERSION: 3.6.3

      - name: Cache Maven packages
        uses: actions/cache@v2
        with:
          path: ~/.m2
          key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
          restore-keys: ${{ runner.os }}-m2

      - name: Build with Maven
        run: mvn -B verify

      - name: Install jx-release-version
        if: ${{ github.event_name == 'push' }}
        uses: Alfresco/alfresco-build-tools/.github/actions/setup-jx-release-version@v1.1.0

      - name: Bump version with jx-release-version
        if: ${{ github.event_name == 'push' }}
        run: |
          git fetch --tags -q
          echo $(jx-release-version -next-version increment) > VERSION

      - name: Set preview version
        if: ${{ contains(github.head_ref, 'preview') }}
        run: |
          BRANCH_NAME=${GITHUB_HEAD_REF#refs/heads/}
          echo 0.0.1-${BRANCH_NAME/\//-}-${GITHUB_RUN_NUMBER}-SNAPSHOT > VERSION

      - name: Set VERSION env variable
        if: ${{ github.event_name == 'push' || contains(github.head_ref, 'preview') }}
        run: |
          VERSION=$(cat VERSION)
          echo set VERSION=$VERSION
          echo "VERSION=$VERSION" >> $GITHUB_ENV

      - name: Deploy with Maven
        if: ${{ github.event_name == 'push' || contains(github.head_ref, 'preview') }}
        run: |
          mvn -B versions:set -DnewVersion=$VERSION -DprocessAllModules=true -DgenerateBackupPoms=false
          mvn -B -s settings.xml deploy -DskipTests
        env:
          MAVEN_USERNAME: ${{ secrets.NEXUS_USERNAME }}
          MAVEN_PASSWORD: ${{ secrets.<PASSWORD>_PASSWORD }}

      - name: Configure git user
        if: ${{ github.event_name == 'push' }}
        run: |
          git config --global user.name $GITHUB_USERNAME
          git config --global user.email $GITHUB_<EMAIL>
        env:
          GITHUB_USERNAME: ${{ secrets.BOT_GITHUB_USERNAME }}

{'fraction_non_alphanumeric': 0.12367491166077739, 'fraction_numerical': 0.011778563015312132, 'mean_word_length': 2.0557804768331085, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 14, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2729018', 'n_tokens_mistral': 2291, 'n_tokens_neox': 2167, 'n_words': 518}