diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4ca74bc..2208d33 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,15 +50,15 @@ jobs: - uses: actions/upload-artifact@v4 if: github.event_name == 'pull_request' with: - name: file-diff-test-1-dependencies-previous - path: ${{ steps.dependency-diff.outputs.dependencies-previous }} + name: file-diff-test-1-dependencies-base + path: ${{ steps.dependency-diff.outputs.file-dependencies-base }} if-no-files-found: error - uses: actions/upload-artifact@v4 if: github.event_name == 'pull_request' with: - name: file-diff-test-1-dependencies-current - path: ${{ steps.dependency-diff.outputs.dependencies-current }} + name: file-diff-test-1-dependencies-head + path: ${{ steps.dependency-diff.outputs.file-dependencies-head }} if-no-files-found: error - uses: peter-evans/find-comment@v3 @@ -77,9 +77,9 @@ jobs: ${{ steps.dependency-diff.outputs.text-diff }} ``` - file path: `${{ steps.dependency-diff.outputs.file-diff }}` - previous dependencies: `${{ steps.dependency-diff.outputs.dependencies-previous }}` - current dependencies: `${{ steps.dependency-diff.outputs.dependencies-current }}` + output path: `${{ steps.dependency-diff.outputs.file-diff }}` + base dependencies: `${{ steps.dependency-diff.outputs.file-dependencies-base }}` + head dependencies: `${{ steps.dependency-diff.outputs.file-dependencies-head }}` edit-mode: replace comment-id: ${{ steps.find_comment.outputs.comment-id }} issue-number: ${{ github.event.pull_request.number }} diff --git a/action.yml b/action.yml index 7d6652c..4a9f392 100644 --- a/action.yml +++ b/action.yml @@ -32,12 +32,12 @@ outputs: file-diff: description: "Path to a file containing the raw diff output" value: ${{ steps.diff-generator.outputs.file-diff }} - dependencies-current: + file-dependencies-head: description: "Path to a file containing dependencies dump from currently checked out ref" - value: ${{ steps.diff-generator.outputs.dependencies-current }} - dependencies-previous: + value: ${{ steps.diff-generator.outputs.file-dependencies-head }} + file-dependencies-base: description: "Path to a file containing dependencies dump from `github.base_ref`" - value: ${{ steps.diff-generator.outputs.dependencies-previous }} + value: ${{ steps.diff-generator.outputs.file-dependencies-base }} branding: color: 'red' icon: 'check-square' diff --git a/entrypoint.sh b/entrypoint.sh index 0cac27c..cd49e1e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -25,26 +25,26 @@ fi current_head=$(git rev-parse HEAD) -./gradlew $INPUT_ADDITIONAL_GRADLE_ARGUMENTS "$INPUT_PROJECT":dependencies --configuration "$INPUT_CONFIGURATION" > dependency_tree_diff_dependencies_current.txt +./gradlew $INPUT_ADDITIONAL_GRADLE_ARGUMENTS "$INPUT_PROJECT":dependencies --configuration "$INPUT_CONFIGURATION" > dependency-tree-diff_dependencies-head.txt git fetch --force origin "$INPUT_BASEREF":"$INPUT_BASEREF" --no-tags git switch --force "$INPUT_BASEREF" -./gradlew $INPUT_ADDITIONAL_GRADLE_ARGUMENTS "$INPUT_PROJECT":dependencies --configuration "$INPUT_CONFIGURATION" > dependency_tree_diff_dependencies_previous.txt -java -jar dependency-tree-diff.jar dependency_tree_diff_dependencies_previous.txt dependency_tree_diff_dependencies_current.txt > dependency_tree_diff_output.txt +./gradlew $INPUT_ADDITIONAL_GRADLE_ARGUMENTS "$INPUT_PROJECT":dependencies --configuration "$INPUT_CONFIGURATION" > dependency-tree-diff_dependencies-base.txt +java -jar dependency-tree-diff.jar dependency-tree-diff_dependencies-base.txt dependency-tree-diff_dependencies-head.txt > dependency-tree-diff_output.txt if [ "$INPUT_DEBUG" == "true" ]; then echo "diff generated" ls -al - realpath dependency_tree_diff_output.txt + realpath dependency-tree-diff_output.txt pwd fi delimiter=$(openssl rand -hex 20) echo "text-diff<<$delimiter" >> $GITHUB_OUTPUT -cat dependency_tree_diff_output.txt >> $GITHUB_OUTPUT +cat dependency-tree-diff_output.txt >> $GITHUB_OUTPUT echo "$delimiter" >> $GITHUB_OUTPUT -echo "file-diff=$(realpath dependency_tree_diff_output.txt)" >> $GITHUB_OUTPUT -echo "dependencies-previous=$(realpath dependency_tree_diff_dependencies_previous.txt)" >> $GITHUB_OUTPUT -echo "dependencies-current=$(realpath dependency_tree_diff_dependencies_current.txt)" >> $GITHUB_OUTPUT +echo "file-diff=$(realpath dependency-tree-diff_output.txt)" >> $GITHUB_OUTPUT +echo "file-dependencies-base=$(realpath dependency-tree-diff_dependencies-base.txt)" >> $GITHUB_OUTPUT +echo "file-dependencies-head=$(realpath dependency-tree-diff_dependencies-head.txt)" >> $GITHUB_OUTPUT git switch --detach "$current_head"