Skip to content

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

@wzieba

Description

@wzieba

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions