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

Remove dependency diff comment if no changes in Gradle files is detected #129

Open
wzieba opened this issue Oct 15, 2024 · 0 comments
Open

Comments

@wzieba
Copy link
Member

wzieba commented Oct 15, 2024

Reproduction:

  1. Prepare a PR with a change to .gradle, .gradle.kts or .toml file
  2. Wait for dependency diff comment to appear
  3. Revert change from point 1

Expected behavior:
Dependency diff commit is removed

Actual behavior:
Dependency diff commit is not removed.

Reason: because no change is detected, the script exits early if no Gradle changes are detected. The script should remove the comment in such case:

if (git diff --name-status "origin/$BASE_BRANCH" | grep -E "\.gradle(\.kts)?|\.toml" --quiet); then
echo "Gradle files have been changed. Looking for caused dependency changes"
else
echo "Gradle files haven't been changed. There is no need to run the diff"
exit 0
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant