diff --git a/.github/workflows/dep-diff.yml b/.github/workflows/dep-diff.yml index 6936f34ceb9..af859216bf7 100644 --- a/.github/workflows/dep-diff.yml +++ b/.github/workflows/dep-diff.yml @@ -6,7 +6,7 @@ on: - master env: # The modules to check for dependencies. If there is more than one they are comma separated - MODULES_TO_CHECK: core-feature-pack + 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 @@ -54,18 +54,59 @@ jobs: - name: Build base working-directory: base run: | - mvn -B install -DskipTests + 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 + 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 }}' - modules: ${{ steps.prepare.outputs.modules_to_check }} 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 }}