<commit_before>name: Dependency Tree

on:
  pull_request_target:
    branches:
    - master
env:
  # The modules to check for dependencies. If there is more than one they are comma separated
  MODULES_TO_CHECK: core-feature-pack/common
  # The name of the labels to use if the dependencies are ok
  DEPS_OK_LABEL_NAME: deps-ok
  # The name of the labels to use if the dependencies changed
  DEPS_CHANGED_LABEL_NAME: deps-changed
  # People/teams to mention in the PR comment if dependencies changed
  CHANGE_MENTIONS: '@wildfly/prod'
jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - name: Set needed env vars in outputs
        id: prepare
        run: |
          echo "::set-output name=base::${GITHUB_BASE_REF}"
          echo "::set-output name=modules_to_check::${MODULES_TO_CHECK}"
          echo "::set-output name=deps_ok_label_name::${DEPS_OK_LABEL_NAME}"
          echo "::set-output name=deps_changed_label_name::${DEPS_CHANGED_LABEL_NAME}"
          echo "::set-output name=change_mentions::${CHANGE_MENTIONS}"

      - name: Clone base version
        uses: actions/checkout@v2
        with:
          ref: ${{ steps.prepare.outputs.base }}
          path: base

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

      # Run the caching against the base version only
      - name: Cache local Maven repository
        uses: actions/cache@v2
        with:
          path: ~/.m2/repository
          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
          restore-keys: |
            ${{ runner.os }}-maven-

      - name: Clone PR version
        uses: actions/checkout@v2
        with:
          path: pr

      - name: Build base
        working-directory: base
        run: |
          mvn -B install -DskipTests -pl $MODULES_TO_CHECK -am

      - name: Grab base dependencies
        id: base-versions
        working-directory: base
        run: |
          i=0
          baseVersionFiles=""
          for module in $(echo "${MODULES_TO_CHECK}" | sed "s/,/ /g")
          do
            baseVersionFile="_base-versions-$i.txt"
            mvn -B dependency:tree -pl "${module}" -DoutputFile="${GITHUB_WORKSPACE}/${baseVersionFile}" || exit 1

            if [ $i -gt 0 ]; then
              baseVersionFiles="${baseVersionFiles},${baseVersionFile}"
            else
              baseVersionFiles="${baseVersionFile}"
            fi
            i=$((i + 1))
          done
          echo "::set-output name=files::${baseVersionFiles}"

      - name: Build PR
        working-directory: pr
        run: |
          mvn -B install -DskipTests -pl $MODULES_TO_CHECK -am

      - name: Grab PR Dependencies
        working-directory: pr
        id: new-versions
        run: |
          i=0
          newVersionFiles=""
          for module in $(echo "${MODULES_TO_CHECK}" | sed "s/,/ /g")
          do
            newVersionFile="_new-versions-$i.txt"
            mvn -B dependency:tree -pl "${module}" -DoutputFile="${GITHUB_WORKSPACE}/${newVersionFile}" || exit 1

            if [ $i -gt 0 ]; then
              newVersionFiles="${newVersionFiles},${newVersionFile}"
            else
              newVersionFiles="${newVersionFile}"
            fi
            i=$((i + 1))
          done
          echo "::set-output name=files::${newVersionFiles}"

      - name: Check versions
        #uses: wildfly/dep-tree-diff@master
        uses: kabir/dep-tree-diff@development
        with:
          token: '${{ secrets.GITHUB_TOKEN }}'
          deps-ok-label: ${{ steps.prepare.outputs.deps_ok_label_name }}
          deps-changed-label: ${{ steps.prepare.outputs.deps_changed_label_name }}
          tool-change-mentions: ${{ steps.prepare.outputs.change_mentions }}
          base-version-files: ${{ steps.base-versions.outputs.files }}
          new-version-files: ${{ steps.new-versions.outputs.files }}
<commit_msg>Revert "tmp - use my checker action"<commit_after>name: Dependency Tree

on:
  pull_request_target:
    branches:
    - master
env:
  # The modules to check for dependencies. If there is more than one they are comma separated
  MODULES_TO_CHECK: core-feature-pack/common
  # The name of the labels to use if the dependencies are ok
  DEPS_OK_LABEL_NAME: deps-ok
  # The name of the labels to use if the dependencies changed
  DEPS_CHANGED_LABEL_NAME: deps-changed
  # People/teams to mention in the PR comment if dependencies changed
  CHANGE_MENTIONS: '@wildfly/prod'
jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - name: Set needed env vars in outputs
        id: prepare
        run: |
          echo "::set-output name=base::${GITHUB_BASE_REF}"
          echo "::set-output name=modules_to_check::${MODULES_TO_CHECK}"
          echo "::set-output name=deps_ok_label_name::${DEPS_OK_LABEL_NAME}"
          echo "::set-output name=deps_changed_label_name::${DEPS_CHANGED_LABEL_NAME}"
          echo "::set-output name=change_mentions::${CHANGE_MENTIONS}"

      - name: Clone base version
        uses: actions/checkout@v2
        with:
          ref: ${{ steps.prepare.outputs.base }}
          path: base

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

      # Run the caching against the base version only
      - name: Cache local Maven repository
        uses: actions/cache@v2
        with:
          path: ~/.m2/repository
          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
          restore-keys: |
            ${{ runner.os }}-maven-

      - name: Clone PR version
        uses: actions/checkout@v2
        with:
          path: pr

      - name: Build base
        working-directory: base
        run: |
          mvn -B install -DskipTests -pl $MODULES_TO_CHECK -am

      - name: Grab base dependencies
        id: base-versions
        working-directory: base
        run: |
          i=0
          baseVersionFiles=""
          for module in $(echo "${MODULES_TO_CHECK}" | sed "s/,/ /g")
          do
            baseVersionFile="_base-versions-$i.txt"
            mvn -B dependency:tree -pl "${module}" -DoutputFile="${GITHUB_WORKSPACE}/${baseVersionFile}" || exit 1

            if [ $i -gt 0 ]; then
              baseVersionFiles="${baseVersionFiles},${baseVersionFile}"
            else
              baseVersionFiles="${baseVersionFile}"
            fi
            i=$((i + 1))
          done
          echo "::set-output name=files::${baseVersionFiles}"

      - name: Build PR
        working-directory: pr
        run: |
          mvn -B install -DskipTests -pl $MODULES_TO_CHECK -am

      - name: Grab PR Dependencies
        working-directory: pr
        id: new-versions
        run: |
          i=0
          newVersionFiles=""
          for module in $(echo "${MODULES_TO_CHECK}" | sed "s/,/ /g")
          do
            newVersionFile="_new-versions-$i.txt"
            mvn -B dependency:tree -pl "${module}" -DoutputFile="${GITHUB_WORKSPACE}/${newVersionFile}" || exit 1

            if [ $i -gt 0 ]; then
              newVersionFiles="${newVersionFiles},${newVersionFile}"
            else
              newVersionFiles="${newVersionFile}"
            fi
            i=$((i + 1))
          done
          echo "::set-output name=files::${newVersionFiles}"

      - name: Check versions
        uses: wildfly/dep-tree-diff@master
        with:
          token: '${{ secrets.GITHUB_TOKEN }}'
          deps-ok-label: ${{ steps.prepare.outputs.deps_ok_label_name }}
          deps-changed-label: ${{ steps.prepare.outputs.deps_changed_label_name }}
          tool-change-mentions: ${{ steps.prepare.outputs.change_mentions }}
          base-version-files: ${{ steps.base-versions.outputs.files }}
          new-version-files: ${{ steps.new-versions.outputs.files }}

{'fraction_non_alphanumeric': 0.11824237765821163, 'fraction_numerical': 0.004355623879067384, 'mean_word_length': 2.050801094177413, 'pattern_counts': {'":': 14, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6175830', 'n_tokens_mistral': 2363, 'n_tokens_neox': 2305, 'n_words': 567}