Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename current/previous -> base/header #120

Merged
merged 1 commit into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand Down
8 changes: 4 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
16 changes: 8 additions & 8 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"