Skip to content

Commit

Permalink
Calculate the diff ourselves
Browse files Browse the repository at this point in the history
  • Loading branch information
kabir committed Jan 4, 2021
1 parent 1ea52ee commit ef2f25b
Showing 1 changed file with 45 additions and 4 deletions.
49 changes: 45 additions & 4 deletions .github/workflows/dep-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}

0 comments on commit ef2f25b

Please sign in to comment.